Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: grouping plot handles?
Date: Wed, 9 Apr 2008 15:38:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 59
Message-ID: <ftinsq$at6$1@fred.mathworks.com>
References: <ftiik2$7ni$1@fred.mathworks.com> <ftikv3$h37$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1207755482 11174 172.30.248.35 (9 Apr 2008 15:38:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 9 Apr 2008 15:38:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:462004



ah cool , i didn't realize you could delete an array of
function handles.

Heres another problem i'm having:
in a for loop, i have this statement:

	if ismember('hNewCam', who) == 1
		delete(hNewCam);
	end

which is just to prevent the handle from being delete the
first time through the loop (since it doesn't exist yet). 
The thing is, I get this error:

??? Error using ==> delete
Invalid handle object.

but if I put a breakpoint at the beginning of the loop and
delete(hNewCam) manually, it works fine!!??

any thoughts?

David
"helper " <spamless@nospam.com> wrote in message
<ftikv3$h37$1@fred.mathworks.com>...
> "David Doria" <daviddoria@gmail.com> wrote in message 
> <ftiik2$7ni$1@fred.mathworks.com>...
> > I would like to do this
> > %group 1
> > a=plot(0,1,'o');
> > b=plot(1,1,'ro');
> > 
> > %group 2
> > c=plot(1,2,'go');
> > 
> > delete(group 1)
> > 
> > how would I do that?
> > 
> > Thanks
> > 
> > Dave
> 
> Try this:
> 
>  %group 1
> group{1}(1) = plot(0,1,'o');
> group{1}(2) = plot(1,1,'ro');
>  
> %group 2
> group{2}(1) = plot(1,2,'go');
>  
> delete(group{1})
> 
> You could used "group1" and "group2" in place of "group{1}" 
> and "group{2}".  However, I placed each group into a 
> different cell of a cell array so it will be easy for you 
> to create (for example) group{142} if you need to.