|
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.
|