help-octave
[Top][All Lists]
Advanced

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

RE: Loop over cell arrays.


From: Hall, Benjamin
Subject: RE: Loop over cell arrays.
Date: Thu, 26 Aug 2004 16:59:41 -0400

Just treat them like a normal array/matrix

data = {"something",[1 2;3 4],10};

for kk = 1:length( data )
        val = data{kk};
        body
endfor

-----Original Message-----
From: Sean Smith [mailto:address@hidden
Sent: Thursday, August 26, 2004 4:50 PM
To: 'address@hidden'
Subject: Loop over cell arrays.


It appears easy enough to loop over <structures> using

for [ key, value] = <structure>
  body
endfor

but I can't find any reference on how to loop over cell arrays.

Any suggestions?

Thanks,
Sean



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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