help-octave
[Top][All Lists]
Advanced

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

Problem with reading lists


From: John W. Eaton
Subject: Problem with reading lists
Date: Tue, 8 Mar 2005 21:34:49 -0500

On  8-Mar-2005, Marcus Vinicius Eiffle Duarte <address@hidden> wrote:

| I just discovered that textread returns lists, instead of cell arrays.
| I didn't find some kind of list2cell function. Is there any built-in
| or m-function to convert one to another.
| I tried the code
| 
|       function cellvar = list2cell( listvar )
|       elements = length( listvar );
|       cellvar = cell( elements, 1 );
|       for aux = 1 : size( listvar, 1 )
|               cellvar{ aux } = listvar( aux );
|       end
| 
| However, when I try 
|       x = list(1,2,3,4); 
|       xx = list2cell(x);
| 
| Octave gives an error and closes.

This is a bug, but I think it is fixed in the current
testing/recommended version of Octave, 2.1.67.

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



reply via email to

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