Matrices A and B are defined in MATLAB as follows A 1 2 3 4

Matrices A and B are defined in MATLAB as follows: >>A = [1 2 3; 4 5 6 7 8 9]: >> B = [5 6 7]; what LATLAB command would you use find a multiplied by B? you must multiply the arrays. What does the following MATLAB command do? What MATLAB commands would you use to solve the following set of linear equations? 2x_1 + x_2 = 1 x_1 + 2x_2 + x_3 = 1 x_2 + 2x_3 + x_4 = 1 x_3 + 2x_4 = 1 What MATLAB commands would you use to plot the following two function on one graph for x = 0 to 10? y = x^3 + x^2 + x + 5 z = sin(x^2 + pi) cos(x^3 + pi/2) Given the following: >> x = 5 >> y = 10; >> ch1 = \'a\' >> ch2 = \'A\' >> z = 0.333 What would be the value of the following MATLAB expressions? x = = y ch1

Solution

1. to simply multiply i will use

C= A*B , the multiplied value will be stored in C matrix

2. This command will change the current MATLAB encoding to the chracter encoding in which you want to work.

3. i will use the matrix command to solve the equation as

[A][X]=[B]

then [X] = [A]^-1 * [B]

the X matrix will return the value pof x1,x2,x3 and x4.

4. first i wil, use linspace command for x to divide 0 to 10 into equal small intervals and then i will use

plot(x,y) command to plot the function. Y will be the function in x.

 Matrices A and B are defined in MATLAB as follows: >>A = [1 2 3; 4 5 6 7 8 9]: >> B = [5 6 7]; what LATLAB command would you use find a multiplied

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site