delete function doesnt work

5 Ansichten (letzte 30 Tage)
Shree Nath
Shree Nath am 14 Okt. 2012
function names_Callback(hObject, eventdata, handles)
d=get(handles.textvis,'Value');
if d==1
delete (handles.texthandles(:));
end
I tried deleting some handle objects, depending on the value of d, but it didnt work.
P.S.- it worked well when i didnt had this 'if loop'. I am not able to detect the problem.

Akzeptierte Antwort

Matt Fig
Matt Fig am 14 Okt. 2012
Did you look at the value of d? Perhaps it is not 1... Take the semicolon off, see what prints to the command window when you trigger that callback.
P.S. There is no such thing as an "if loop", only "if statements."
  5 Kommentare
Walter Roberson
Walter Roberson am 14 Okt. 2012
Put in a breakpoint at the delete() call. Do you reach that point?
If it is "a variable depicting the handles visibility", then is it a uicontrol() and if so what Style is it? If it isn't a handle graphics handle, then get() is not appropriate for it.
Try displaying d-1 to see whether the value might be near 1 but not exactly equal to it.
Shree Nath
Shree Nath am 14 Okt. 2012
I made textvis as a variable stored in handles structure, accordingly changed the code, but still no good.
i see the problem... compiler doesnt reach that point.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by