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

need help with Q#5 (v) using Matlab For 0 vary from 0 to 2, in steps of (0.01).

ID: 1765633 • Letter: N

Question

need help with Q#5 (v) using Matlab

For 0 vary from 0 to 2, in steps of (0.01). Define an array of distances RI-5 cos(4*0) (a) make a polar plot of r versus ? with a red color line. using the same 6 array as in (a) Q#5 write a script which performs the following operations (in sequence) (i) creates a 20 x 40 aray, A, ?n which each element(or entry) ?n rows l through is assigned the value 1 and each element in rows I1 through 20 is assigned the value 2 (ii) creates a new 20x40 array, B, which is the same as A except row 11 for which (ii) creates a new 20 x 41 array, C, which is the same as B for columns 1 through 40 (iv) creates a new 20 x 41 array, P, which is the same as C except the first ten entries (v) creates a new 20 x 41 array, Q. which is the same as P except the (1,2) entry for B(11j) Ij, 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(??), for 1 is 10:

Explanation / Answer

Answer to part i-

A = zeros(20,40)

for i = 1:10
for j = 1:40
A(i,j) = 1
end
end

for k=11:20
for l = 1:40
a(k,l) = 2;
end
end

Answer to part ii-

B = A

for a = 1:40

B(11, a) = 1/a

end

Answer to iii-

C= zeros (20,41);

C = C+B;

C(:, 41) = 3;

Answer to iv-

P = C;

for z=1:10;

P(z, z) = z+C(z,z);

end