Question: MATLAB: rewrite the following code using while loops instead of for loops. needs to be matlab coding and display the same output as shown in
n=randi([4,8]);%n is the s for loop (i) A= zeros (n,n); for i=1:n for j=1:n A(i,j)=i+j end end A for 100p (ii) A=zeros(n,n);fori=1:nforj=i:nA(1,j)=i+j;A(j,i)=A(i,j); end end A
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
