[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pcolor in octave 3.0 requires same dimension
From: |
Dukeja |
Subject: |
Re: pcolor in octave 3.0 requires same dimension |
Date: |
Thu, 27 Dec 2007 11:25:36 -0800 (PST) |
Thanks both of your help. It works now!
I am also very pleased that Octave 3.0 has the command line history recall
just like Matlab. It is GREAT!
Much thanks for this significant upgrade!:clap:
Puck
Søren Hauberg wrote:
>
> tor, 27 12 2007 kl. 10:51 -0600, skrev Puck Ja:
>> I just upgraded to octave 3.0 and was so glad to find "pcolor" is
>> available without any addon, such as octplot. My main usage is to
>> display a 2D matrix. However, one thing strange to me is that pcolor
>> requires equal dimension (x=y) to work.
>> octave:6> pcolor(mat)
>> error: surface: x, y, and z must have same dimensions
>> error: evaluating if command near line 95, column 7
>> error: evaluating if command near line 87, column 5
>> error: evaluating if command near line 76, column 3
>> error: called from `surface:__surface__' in file
>> `/usr/local/share/octave/3.0.0/m/plot/surface.m'
>> error: called from `surface' in file
>> `/usr/local/share/octave/3.0.0/m/plot/surface.m'
>> error: evaluating assignment expression near line 48, column 7
>> error: called from `pcolor' in file
>> `/usr/local/share/octave/3.0.0/m/plot/pcolor.m'
>>
>> Why is that limitation. Certain I can work around it by making a
>> larger square matrix and then using axis([x1 x2 y1 y2]) to make it
>> display what I look for, but that is way to silly. Is there any other
>> way to work around it?
> It's just a small bug in pcolor. The attached patch fixes it.
>
> Søren
>
> Index: scripts/plot/pcolor.m
> ===================================================================
> RCS file: /cvs/octave/scripts/plot/pcolor.m,v
> retrieving revision 1.4
> diff -u -r1.4 pcolor.m
> --- scripts/plot/pcolor.m 10 Dec 2007 06:52:51 -0000 1.4
> +++ scripts/plot/pcolor.m 27 Dec 2007 18:03:49 -0000
> @@ -38,7 +38,7 @@
> c = x;
> z = zeros (size (c));
> [nr, nc] = size (c);
> - [x, y] = meshgrid (1:nr, 1:nc);
> + [x, y] = meshgrid (1:nc, 1:nr);
> elseif (nargin == 3)
> z = zeros (size (c));
> else
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
>
--
View this message in context:
http://www.nabble.com/pcolor-in-octave-3.0-requires-same-dimension-tp14516572p14517411.html
Sent from the Octave - General mailing list archive at Nabble.com.
Re: pcolor in octave 3.0 requires same dimension, David Bateman, 2007/12/27