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

For and While Loops


try:
a=100
for i=1:a
    for j=1: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 Oct 17, 2007 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College