MATLAB: Help with Matlab homework question

homework

Use loops to vreate a 4 x 3 matrix in which the value of each elemen is the sum of its row number and its column number divided by the square of its column number. for example the value of element (2,3) is (2+3)/3^2 = 0.5555 I tried : for i=2:5 a(i)=i(2+3)/3^2 end a not sure what I am doing wrong can y please help!

Best Answer

you are going to need 2 loops:
x = zeros(10)
for r = 1:10
for c = 1:10
x(r,c) = % for you to fill in
end
end
Related Question