Text-only Table of Contents (frame/ no frame)
(18) For and While Loops Previous Top Next

For and While Loops



try:
a=100;
for i=1:a
    for j=1:2:a
       x(i,j)=i^2+3*j +1;
    end
end

done=false;
max=1300;
i=1;
while(~done)
    y(i)= i^3*2+1;
    if y(i) >max
      done=true;
    end
    i=i+1;
end









Previous Top Next


For_and_While_Loops.src  last modified Sep 29, 2009 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College