help-octave
[Top][All Lists]
Advanced

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

error: only one index allowed for lists


From: Prasenjit Kapat
Subject: error: only one index allowed for lists
Date: Mon, 3 Oct 2005 12:51:08 -0400

Hi,
The subject gives the error message. A toyed down version of what I
want to do is this..

> 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

I get what this means. Is there any way around ? To be more fair to my
problem, I want a 2x3 matrix b = some_function(a) such that, b(i,j) =
a{1}(i,j) + a{2}(i,j) + a{3}(i,j). Of course, in real terms these
dimensions are huge, so is the 'length of the list'. Thus the brute
force way is expensive,O(n^3). Some N-dimensional array, like matlab ?
Well, I do not have administrative access to the machine, and the
octave version is an age old one: 2.1.50, possibly on fedora 1.

Any comments ?
Thanks
Kapat



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