octave-maintainers
[Top][All Lists]
Advanced

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

Re: Patch Re: iterating cell arrays


From: Dmitri A. Sergatskov
Subject: Re: Patch Re: iterating cell arrays
Date: Thu, 24 Jun 2004 15:03:31 -0600
User-agent: Mozilla Thunderbird 0.7 (X11/20040615)

David Bateman wrote:
Err, I suppose I wasn't clear. The test cases I gave for R12 was one
that gave a sensible result. Rather what does

a = rand(2,2,2)
j=0
for i = a
disp(j);
j=j+1;
disp(i);
end

give under R13 or R14


This is for R13:

>> a = rand(2,2,2)

a(:,:,1) =

    0.9501    0.6068
    0.2311    0.4860


a(:,:,2) =

    0.8913    0.4565
    0.7621    0.0185

>> j=0

j =

     0

>> for i = a
disp(j);
j=j+1;
disp(i);
end
     0

    0.9501
    0.2311

     1

    0.6068
    0.4860

     2

    0.8913
    0.7621

     3

    0.4565
    0.0185

>>

-------

Regards,
Dmitri.



reply via email to

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