help-octave
[Top][All Lists]
Advanced

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

problem plotting "N-d object"


From: Sergei Steshenko
Subject: problem plotting "N-d object"
Date: Fri, 17 Feb 2012 07:15:15 -0800 (PST)

Hello,

here is a screen session:

"
octave:3> foo(1,1,:) = [1 2 3]
foo =

ans(:,:,1) =  1
ans(:,:,2) =  2
ans(:,:,3) =  3

octave:4> plot(foo(1,1,:));
error: transpose not defined for N-d objects
error: called from:
error:   
/home/qemu/AFSWD/20111122/octave-3.4.2/share/octave/3.4.2/m/plot/private/__plt__.m
 at line 179, column 8
error:   
/home/qemu/AFSWD/20111122/octave-3.4.2/share/octave/3.4.2/m/plot/private/__plt__.m
 at line 104, column 17
error:   
/home/qemu/AFSWD/20111122/octave-3.4.2/share/octave/3.4.2/m/plot/plot.m at line 
194, column 9
octave:4> plot(foo(1,1,:)(:));
octave:5>             

".

I don't understand why 'octave' complains about N-d objects - to me 
"foo(1,1,:)" looks like a 1-d object. Because the first two of the three 
indexes are fixed in the expression.


And adding "(:)" solves the problem.

Just wondering - should it be that hard for end user ? Does Matlab behave the 
sane way ?

Thanks,
  Sergei.



reply via email to

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