help-octave
[Top][All Lists]
Advanced

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

arrays


From: Nathan Weisz
Subject: arrays
Date: Fri, 15 Aug 2003 18:49:19 +0200

Hi,

I'd like to repeat a question posted by Phil Reardon about 2 years ago:
Can octave treat three dimensional arrays like A(i,j,k)? It seems to
accept this form on the right side an assignment, but not the left.
What is the rule here? Thanks in advance!

The short answer to that was: no.

I'm asking because I get error messages when trying to create 3-dimensional arrays in Matlab-style, e.g.:
octave:29> a = rand(5);
octave:30> b= rand(5);
octave:31> c = a;
octave:32> c(:,:,2) = b;
error: invalid number of indices (3) for indexed assignment
error: assignment failed, or no method for `matrix = matrix'
error: evaluating assignment expression near line 32, column 10

Something I can do about it?

Best,
Nathan

reply via email to

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