octave-maintainers
[Top][All Lists]
Advanced

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

Re: No bool matrices for imagesc in tip?


From: Søren Hauberg
Subject: Re: No bool matrices for imagesc in tip?
Date: Sat, 01 Nov 2008 22:59:13 +0100

lør, 01 11 2008 kl. 21:51 +0000, skrev Michael Goffioul:
> On Sat, Nov 1, 2008 at 7:15 PM, Thomas Weber
> <address@hidden> wrote:
> > Am Samstag, den 01.11.2008, 10:14 +0000 schrieb Michael Goffioul:
> >> My question was badly expressed. It should have been: does
> >> Matlab accepts that you "set(img, 'cdata', m)", where img is
> >> an image handle and m is a bool matrix?
> >
> >>> m = ones(10,10)>0;
> >>> img = figure()
> >>> set(img, 'cdata', m)
> > ??? There is no 'cdata' property in the 'figure' class.
> 
> Indeed. As I mentioned, img should be an image handle, not
> a figure handle.

The following code

  f = imshow (rand (50));
  m = ones(50)>0;   
  set(f, 'cdata', m) 

works just fine, and the resulting figure is a white image. Also,

  get (f)

prints

        AlphaData = [1]
        AlphaDataMapping = none
        Annotation = [ (1 by 1) hg.Annotation array]
        CData = [ (50 by 50) logical array]
        CDataMapping = scaled
        DisplayName = 
        EraseMode = normal
        XData = [1 50]
        YData = [1 50]

        BeingDeleted = off
        ButtonDownFcn = 
        Children = []
        Clipping = on
        CreateFcn = 
        DeleteFcn = 
        BusyAction = cancel
        HandleVisibility = on
        HitTest = on
        Interruptible = off
        Parent = [171.001]
        Selected = off
        SelectionHighlight = on
        Tag = 
        Type = image
        UIContextMenu = []
        UserData = []
        Visible = on

Søren



reply via email to

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