[Top][All Lists]

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

Re: error: only one index allowed for lists

From: Tom Holroyd
Subject: Re: error: only one index allowed for lists
Date: Mon, 03 Oct 2005 13:38:39 -0400
User-agent: Mozilla Thunderbird 1.0.6-1.1.fc3 (X11/20050720)

a = cell(1,3);
a{1} = zeros(2,3);
a{2} = ones(2,3);
a{3} = zeros(2,3);
a{:}(1,1)  ## I want this to give [ 0 1 0] as the answer, instead the error...

error: only one index allowed for lists

In 2.9.3, this still doesn't work, but the error message is different.

Anyway, is it always a 2x3 matrix?  You could do

b = zeros([2,3,3]);
b(:,:,1) = a{1}
then b(1,1,:) is what you want.  I have no idea if this works on 2.1.50.

Dr. Tom Holroyd
"A man of genius makes no mistakes. His errors are volitional and
are the portals of discovery." -- James Joyce

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

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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