Invalid object handle error in Matlab

后端 未结 2 602
广开言路
广开言路 2021-01-24 16:33

I have the following code which is a graphic rendering of the movement of a satellite around the Earth.

function ex
global state;
fh = figure(\'Menu\',\'none\',\         


        
相关标签:
2条回答
  • 2021-01-24 17:10

    Finally, I have found that there was a cla command line, which was the guilty of the error, in the main program.

    0 讨论(0)
  • 2021-01-24 17:13

    I suspect this is for a Matlab GUI?

    If so you need to pass the handles variable to the script, normally matlab passes eventdata and hObject as well as a standard procedure for all functions, callbacks and etc.

    function ex(hObject, eventdata, handles)
    

    And don't forget to update the GUI data to close the function.

    guidata(hObject,handles);
    

    I think all your nested functions that use the handles structure are going to require this as well.

    Hope this helps.

    0 讨论(0)
提交回复
热议问题