help-octave
[Top][All Lists]
Advanced

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

Re: Function in a Loop output problem


From: Jaroslav Hajek
Subject: Re: Function in a Loop output problem
Date: Wed, 8 Sep 2010 20:55:40 +0200

On Wed, Sep 8, 2010 at 5:04 PM, bpabbott <address@hidden> wrote:
> On 08 Sep, 2010,at 10:58 AM, dirac <address@hidden> wrote:
>
> Sorry I should have made it more clear. a and b are vectors of equal lengths
> but not for each iteration i.e for i=1 length(a)=399 length(b)=399 but for
> i=2 length(a)=length(b)=421 etc
>
> Thanks again Ben!
> MA
>
>
> The you can use cells to store the info.
> a = b = cell (1, 20);
> for i = 1:20
>   [a{i}, b{i}] = function (variables);
> endfor


or
[a, b] = cellfun (@myfunc, variables_in_cell);


-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

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