[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: No bool matrices for imagesc in tip?
From: |
David Bateman |
Subject: |
Re: No bool matrices for imagesc in tip? |
Date: |
Fri, 31 Oct 2008 17:21:41 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.16 (X11/20080724) |
Thomas Weber wrote:
Hi,
consider the following:
imagesc(ones(10,10)>0)
This works in 3.0.1, but fails in current tip (8487:dc62132651db) with
imagesc(ones(10,10)>0)
error: invalid value for array property "cdata"
error: set: expecting argument 2 to be a property name
error: set: expecting argument 4 to be a property name
error: set: expecting argument 6 to be a property name
error: called from:
error: /home/weber/sources/vcs/mercurial/octave-build/scripts/image/__img__.m
at line 60, column 7
error: /home/weber/sources/vcs/mercurial/octave-build/scripts/image/image.m
at line 78, column 5
error: /home/weber/sources/vcs/mercurial/octave-build/scripts/image/imagesc.m
at line 114, column 7
error: /home/weber/sources/vcs/mercurial/octave-build/scripts/image/imagesc.m
at line 63, column 9
error: A(I): Index exceeds matrix dimension.
error: called from:
error:
/home/weber/sources/vcs/mercurial/octave-build/scripts/plot/__go_draw_axes__.m
at line 334, column 22
error:
/home/weber/sources/vcs/mercurial/octave-build/scripts/plot/__go_draw_figure__.m
at line 58, column 8
error:
/home/weber/sources/vcs/mercurial/octave-build/scripts/plot/gnuplot_drawnow.m
at line 66, column 5
Casting the bool matrix to double works around this, but is this expected?
Thomas
The line concerned is
tmp = __go_image__ (ca, "cdata", img, "xdata", xlim, "ydata", ylim,
"cdatamapping", "direct", varargin {:});
and as img is a logical array then cdata is set from it. The next part
of the issue is that in graphics.h.in in the image class there is the code
void init (void)
{
xdata.add_constraint (2);
ydata.add_constraint (2);
cdata.add_constraint ("double");
cdata.add_constraint ("uint8");
cdata.add_constraint (dim_vector (-1, -1));
cdata.add_constraint (dim_vector (-1, -1, 3));
}
and so cdata is required to be either a double or an uint8 array. Does
adding the line
cdata.add_constraint("logical");
help?
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary