help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating arrays from variables


From: Carnë Draug
Subject: Re: creating arrays from variables
Date: Mon, 2 May 2011 03:32:27 +0100

On 2 May 2011 02:27, shay <address@hidden> wrote:
> which is defining it as a zeros array and therefore outputting a column of
> zeros with the number of rows defined by the number of loops. Is this the
> problem?
> If so, is there a way to show the results as they are produced within the
> loop?

You can set the length of the column that is shown, which is easier
since you already have a counter.

xx = 1;
yy = zeros(max_loops, 1);
counter = 0;

while  (xx < 10)
   xx = 2*xx;
   ++counter;
   yy(counter) = xx;
   yy(1:counter)
endwhile

Carnë Draug


reply via email to

[Prev in Thread] Current Thread [Next in Thread]