From: Amby on
I am creating a user interface in Matlab with a bunch of root
objects. I have a handle to a graphic object that I want to delete
each time a new one is to be created. But I keep on getting an
error message " Error using ==> delete
Root object may not be deleted" each time I tried to delete it.

Does anyone know how to solve this problem?
Thank you,
Ambrose
From: us on
Amby:
<SNIP trying to delete ML...

> I keep on getting an error message " Error using ==> delete Root
object may not be deleted"...

you typically get this message if you try this

delete(0);

the question, therefore, is: where does your handle come from as -
for some reason - it's zero (0) if you try to delete it...

us
From: Alexander Ranaldi on
The "root object" is MATLAB's main figure, it cannot be deleted. The
root figure always has a handle of 0. If you attempt to delete the
root figure, you will receive an error:

>> delete(0)
??? Error using ==> delete
Root object may not be deleted.

I don't quite understand what you mean by creating "a bunch of root
objects", can you elaborate?

Alex


On Jul 6, 10:51 am, Amby <ambr...(a)lickenbrock.com> wrote:
> I am creating a user interface in Matlab with a bunch of root
> objects. I have a handle to a graphic object that I want to delete
> each time a new one is to be created. But I keep on getting an
> error message " Error using ==> delete
> Root object may not be deleted" each time I tried to delete it.
>
> Does anyone know how to solve this problem?
> Thank you,
> Ambrose