PDA

View Full Version : Creating array with while loop results


ldelgad8
28 Sep 2007, 3:49am
How do you store the results of a while loop as an array, so I can do a min, max, and median.

thank you,
ld

shwaip
28 Sep 2007, 5:41am
you'll want to use a variable to keep track of the index:


ind=1;
while (whatever)
%code
answers(ind) = whatever you want;
ind = ind + 1;

end