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\',\
Finally, I have found that there was a cla command line, which was the guilty of the error, in the main program.
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.