Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Develop a M-file to calculate the following (1) Use for-loop of Matlab (2) Us

ID: 3725871 • Letter: 1

Question

1. Develop a M-file to calculate the following (1) Use for-loop of Matlab (2) Use while-loop of Matlab 2. For a matrix (1) Use Matlab command to identify the dimension s (2) Use Matlab command to calculate the transpose (3) Manually calculate the determinate of the matrix to (4) Manually calculate the inverse Matrix and compare (5) Calculate the eignvalues and eignvectors of the of the Matrix matrix compare Matlab result with Matlab result Matrix if it has 3. (Question 8.3) Write the following set of equations in matrix form 50 5x 7 x2 4x2 +7x3 +30 0 -7x,-40-3x2 + 5 x, Use Matlab to solve the unknowns. In addition, use the it to compute the transpose and the inverse of the coefficient matrix

Explanation / Answer

//this is the matlab code Ans -1 is below with both parts :-

1.1 - The for loop for the matlab

//this is the code for the for loop of the matlab

for a = 10:20
fprintf('value of a: %d ', a);
end

//this will be the for loop ,in which the upper and lower limit is given and
//the output will be printed accordingly.
/-------------xxxxxx-----------/

1.2 This is the code for the while loop in the matlab.

//this is the simple while loop for printing the squares of the number
a = 1;
% while loop execution
while( a < =10 )
fprintf('value of a: %d ', a*a);
a = a + 1;
end

//this will print the squares of the numbers till 10.
//in while loop first,we check the condition and then we print the statements.