Example Using Loops (what you do in most programming languages) m=rand(5,1000); l=rand(5,1000);
w=rand(5,1000); h=rand(5,1000);
[rows,cols] =size(m);
for i= 1:rows
for j=1:cols
density(i,j)=m(i,j)/(l(i,j)*w(i,j)*h(i,j));
end
end
Example Using Array Operations m=rand(5,1000); l=rand(5,1000);
w=rand(5,1000); h=rand(5,1000);
density=m./(l.*w.*h);