This is an assignment so I know there are other ways to sum but the teacher asks specifically for a for loop. I'm not familiar with the for loop so please bear with me.
A = randi([10,10],[12,12])total=0for i=1:size(A,1) for j=1:size(A,2) total=total + A(i,j) endendtotal = sum(A(:))
Thanks in advance.
Best Answer