modeling ans design please make your answer clear Ill rate i

modeling ans design

please make your answer clear I\'ll rate it thank u
10. 16 ptsl Show what script in Matlab used to compute the following serms sor aiseo assigned and y are row vectors of the same seel, x-log(y) clear,A 1:3 6linMAN N second command third command on the screen after the first command What will display b. What will display on the screen afner the second command? what will display on the screen after thethird command d, ust another way of computingthe third command in metiab?

Solution

%Show what script in Matlab used to compute the following terms for any x

%and y alread assigned. (x and y are row vectors of the same size.)

x = [1 2 3 4]; %Assume

y = [5 6 7 8]; %Assume

%a. y^-1 . x^3 / (x - log(y))

z = (y .^ -1 .* x .^ 3) ./ (x - log(y))

%b. (y / x - x / 5)^-1

z = (y ./ x - x ./ 5) .^ -1

%Given the set of commands in matlab.

clear;

A = [1 1;3 6];inv(A) %first command.

%a. What will display on the screen after the first command.

%An inverse of A i.e., 1/(ad-bc)[d -b; -c a] should be the answer.

%So, the output is: [2 -0.33; -1 0.33]

B=[2;-3];Q=[B A*[-1;3]];det(Q) %second command;

%b. What will display on the screen after the second command.

%Determinant of Q should be printed.

%So, the output is: 36

sqrt(Q(:,2).*Q(:,2)) %third command

%c. What will display on the screen after the third command.

%sqrt of second column of Q multiplied by second column of Q.

%So, the output is: [2:5]

%d. List another way of computing the third command in matlab.

%We can use the ^0.5 to compute the square root, instead of using sqrt.

%So, the other way is:

(Q(:,2).*Q(:,2)) .^ 0.5

modeling ans design please make your answer clear I\'ll rate it thank u 10. 16 ptsl Show what script in Matlab used to compute the following serms sor aiseo ass

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site