octave-maintainers
[Top][All Lists]
Advanced

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

[Fwd: Re: Loop over cell arrays.]


From: Paul Thomas
Subject: [Fwd: Re: Loop over cell arrays.]
Date: Fri, 27 Aug 2004 07:46:59 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

This goes in Matlab 5

mycell = { 'foo' , 1.0 , 'bar' };
for tmp = mycell ; disp( tmp ) ; end ;

but gives "error: invalid type for loop expression near .." in octave-2.1.57

Another for the "todo" list?

Paul T
--- Begin Message --- Subject: RE: Loop over cell arrays. Date: Thu, 26 Aug 2004 14:43:59 -0700
version returns 2.1.36

thanx again, I'll upgrade later tonight.

-----Original Message-----
From: John W. Eaton [mailto:address@hidden
Sent: Thursday, August 26, 2004 2:40 PM
To: Sean Smith
Cc: 'Hall, Benjamin'; 'address@hidden'
Subject: RE: Loop over cell arrays.


On 26-Aug-2004, Sean Smith <address@hidden> wrote:

| length(data)
| ans = -1
| 
| that's my problem.
| 
| size(data)
| ans =
| 
|   -1  -1
| 
| nothing seems to access the dimensions of this thing.

What version of Octave are you using?  It seems to work correctly with
the current recommended version, 2.1.57:

  octave:1> x = {"foo", 1, "bar"};
  octave:2> size (x)
  ans =

    1  3

  octave:3> length (x)
  ans = 3

jwe



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



--- End Message ---

reply via email to

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