help-octave
[Top][All Lists]
Advanced

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

iteration of cell array


From: Stefan van der Walt
Subject: iteration of cell array
Date: Thu, 3 Jun 2004 14:59:38 +0200
User-agent: Mutt/1.4.1i

Hi everyone

Is there a shorthand way if iterating over the items in a cell array?

I would like to do something like

i = {1,2,3};
for j = i
  disp(j)
endfor

At the moment it looks like you have to do

i = {1,2,3};
for j = 1:length(i)
  disp(i{j})
endfor

Thanks,
Stefan



-------------------------------------------------------------
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]