[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mesh plot error
From: |
Erich Schneider |
Subject: |
Re: mesh plot error |
Date: |
Mon, 21 Dec 98 12:26:42 |
The following code works:
x=linspace(0,10,200);
y=linspace(0,10,100);
z=zeros(100,200);
According to the Matlab documentation you should meet the following
conditions:
length(x)=n
length(y)=m
[m,n]=size(Z)
There's a similar statement in the help for mesh in octave:
"If x and y are vectors, then a typical vertex is (x(j), y(i),
z(i,j))."
The documentations seems to be correct in both cases.
Regards,
Erich Schneider
On Fri, 18 Dec 1998 14:54:13 -0500, Brian Tyrrell wrote:
>The following is a replication of an error I encountered when writing a
>script:
>
>octave:1> x=linspace(0,10,100);
>octave:2> y=linspace(0,10,200);
>octave:3> z=zeros(100,200);
>octave:4> rows(z)
>ans = 100
>octave:5> columns(z)
>ans = 200
>octave:6> length(x)
>ans = 100
>octave:7> length(y)
>ans = 200
>octave:8> mesh(x,y,z);
>error: mesh: rows (z) must be the same as length (x) and
>columns (z) must be the same as length (y)
>error: evaluating index expression near line 80, column 9
>error: evaluating if command near line 56, column 7
>error: evaluating if command near line 53, column 5
>error: evaluating if command near line 39, column 3
>error: called from `mesh' in file
>`/home2/tyrrell/octave/share/octave/2.0.13.95/m/plot/mesh.m'
>octave:8>
>
>
>According to the error message, "rows (z) must be the same as length (x) and
>columns (z) must be the same as length (y)," but this condition is met.
>
>However, "mesh(y,x,z)" works. Is it the case that the documentation and
>error message are incorrect, or is mesh implemented backwards? (Or am I
>going crazy?)
----------------------------------------------------------------------
Erich Schneider, Dipl.-Phys. | address@hidden
Neurologische Forschung | address@hidden
Ludwig-Maximilians-Universit"at |
Klinikum Grosshadern, M"unchen | Fax: +49,89,70906,101
- mesh plot error, Brian Tyrrell, 1998/12/18
- Re: mesh plot error,
Erich Schneider <=