RosettaCodeData/Task/Loops-Foreach/Octave/loops-foreach-1.octave
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

8 lines
178 B
Text

a = [ 1,4,3,2 ];
b = [ 1,2,3,4; 5,6,7,8 ];
for v = a
disp(v); % output single values: 1,4,3,2
endfor
for v = b
disp(v); % v is the column vector [1;5], then [2;6] ...
endfor