I have a simple MATLAB GUI Code, find attached. All it does is when a button is pressed it runs a function.
However when I press this button twice, it is throwing an error
Undefined function 'GUI' for input arguments of type 'struct'.
Error in @(hObject,eventdata)GUI('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.pushbutton1, 'enable','off');
output = randomFunction();
a = 1
while(1)
a = a+1
if a == 4
break;
end
end
set(handles.pushbutton1, 'enable','on');
randomFunction
change your current working directory? – Suever