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

the square of the corresponding element in Q--- for example, R(1,2) will be assi

ID: 3283485 • Letter: T

Question

the square of the corresponding element in Q--- for example, R(1,2) will be assigned the value 49;

need help with Q#5 (vi) using Matlab

re vary from 0 to 2%, in steps of (0.01)?. Define an array ofdistances R1-5*cos(4*0) a) make a polar plot of r versus 0 with a red color linc. using the same 0 array as in (a) Q#5 Write a script which performs the following operations (in sequence) i) creates a 20 x 40 array, A, in which each element (or entry) in rows 1 through 10 is assigned the value 1 and cach element in rows 11 through 20 is assigned the () creates a new 20x40 array, B, which is the same as A except row I1 for which (iii) creates a new 20 x 41 array, C, which is the same as B for columns l through 40 (iv) creates a new 20 x 41 array, P, which is the same as C except the first ten entries ( creates a new 20 x 41 array, Q, which is the same as P except the (1.2) entry for (vi) creates a new 20 x 41 array, R, in which cach clement is the square of the value 2 B(. /j, for 1 Sjs40; but also includes a column 41 in which all elements are assigned the value 3; on the main diagonal for which P(ii)-i * c(ii), for i sis io; which Q(1,2) is assigned the value 7;

Explanation / Answer

Matlab Code

(i)

A=zeros(20,40);

A(1:10,:)=1;

A(11:20,:)=2;

disp(A);

(ii)

B=A;

j=1:40;

B(11,j)=1./j;

disp(B);

(iii)

C=zeros(20,41);

C=B;

disp(C);

(iv)

P=C;

i=1:10;

P(i,i)=i.*C(i,i);

disp(P);

(v)

Q=P;

Q(1,2)=7;

disp(Q);

(vi)

i=1:20;

j=1:41;

R=zeros(20,41);

R(i,j)=Q(i,j).*Q(i,j);

disp(R);