Path: news.mathworks.com!not-for-mail
From: "Dina " <corsair_dee@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: passing images between two GUI
Date: Sat, 9 Aug 2008 01:14:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 50
Message-ID: <g7ir0p$9sf$1@fred.mathworks.com>
References: <g7immk$igr$1@fred.mathworks.com> <21579291.1218241707359.JavaMail.jakarta@nitrogen.mathforum.org>
Reply-To: "Dina " <corsair_dee@hotmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1218244441 10127 172.30.248.38 (9 Aug 2008 01:14:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 9 Aug 2008 01:14:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1461162
Xref: news.mathworks.com comp.soft-sys.matlab:484621



bogfrog <jmcgraw@rcn.com> wrote in message
<21579291.1218241707359.JavaMail.jakarta@nitrogen.mathforum.org>...
> > i watched this video .. i just dunno how to apply
> > that on
> > axes .. i'm a matlab newbie
> > 
> > but thanx anyway
> 
> Well what you should take away, is that you can store your
data using setappata() and then get it anywhere else using
the handle to where it is stored.  So, you might have this
in the _opening function_ of your main gui:
> 
> setappdata(0,'hMainGui',gcf); %note: gcf gets the handle
> 
> then, once you load up your image elsewhere in your code,
you can do this:
> 
> setappdata(hMainGui,'myImage',imageMatrix);
> 
> then inside the functions for your _other_ gui, you do this:
> 
> hMainGui = getappdata(0,'hMainGui');
> imageMatrix = getappdata(hMainGui,'myImage');
> 
> and you will have access to the image in your new gui.


it gives me this error

 Undefined function or variable 'hMainGui'.

Error in ==> Main>Main_OpeningFcn at 56
setappdata(hMainGui,'C',imageMatrix);

Error in ==> gui_mainfcn at 210
    feval(gui_State.gui_OpeningFcn, gui_hFigure, [],
guidata(gui_hFigure), varargin{:});

Error in ==> Main at 42
    gui_mainfcn(gui_State, varargin{:});

>> 

i would really appreciate it if u gave me more details ..
like what should i write in the pushbutton callback?


thanks alot