Azzera filtri
Azzera filtri

HOW TO CALCULATE LINE BY LINE

1 visualizzazione (ultimi 30 giorni)
heir ancestors
heir ancestors il 26 Gen 2017
Risposto: Jan il 26 Gen 2017
Hello Every one ; I have a matrix A of a 6*7 elements
A11 A21 A31 A41 ...
A12 A22 A32 A42 ...
A13 A23 A33 A43 ...
. . . . ...
if I want to make a for loop but I want to calculate line by line : I mean : I want to calculate : A11, A12, A13...after go to the second column calculate : A21,A22,A23, after go to third column calculate : A31,A32,A33 ....
If I put the loop
[s z]=size(A)
for i=1:s-1
for j=1:z
for y=2:s
B(i,j)=A(i,j)+cosd (A(y,j))
end
end
end
How can I calculate line by line ? Calculates first line of elements, then second line of elements then third ...as explained before ?
Thank you in advance

Risposte (1)

Jan
Jan il 26 Gen 2017
Perhaps this helps already:
A = rand(3,4);
for iLine = 1:3
disp(A(iLine, :))
end

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by