Problem in MATLAB GUI. Invalid or deleted object..

set(handles.scale_box,'enable','on'); % This line works
st_scale = st_variogram_pooled(data_train); % external code to calculate scale
set(handles.scale_box, 'String', st_scale);% This line gives the above error
% All set commands give the error from here on in the callback

댓글 수: 4

Calling the function 'st_variogram_pooled' is deleting all the objects in the gui.
Adam
Adam 2016년 6월 6일
st_variogram_pooled doesn't have access to the objects in the GUI so the only way it could delete them is if it uses functions like findall to do horrendous things to a UI.
But unless you can post that function there isn't really anything much we can say on it.
Actually I figured this out myself. There was a "close all;" command in the function 'st_variogram_pooled' and it was deleting all the objects in the GUI.
Thanks, Shrey for asking this ques. I had the same problem and now I have figured.

댓글을 달려면 로그인하십시오.

답변 (1개)

Shameer Parmar
Shameer Parmar 2016년 6월 9일

0 개 추천

According to me, it seems like the function 'st_variogram_pooled(data_train)' is calculating the scale in numeric format, so the value of variable 'st_scale' will be in numeric format and you are trying to put it into string format for GUI field 'scale_box' in next set() command.
Try to use:
set(handles.scale_box, 'String', num2str(st_scale));
same for all other set commands. Convert num into string using num2str command as I shown above.

댓글 수: 2

There was no problem with set command. I have explained the problem in a comment to my question. Thank You for answering.
Ok, so it seems the problem with function "st_variogram_pooled(data_train)", Can you please provide the details about this function. like logic inside this function or please attach your files so that I can debug and help you..

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Desktop에 대해 자세히 알아보기

제품

질문:

2016년 6월 6일

댓글:

2018년 8월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by