Question

Whenever I access my gui via typing guide untitled in command line and pushing the green arrow called Run Figure it does work perfectly.

But when I try to run it simply by clicking untitled.fig in the sidebar I get some errors as I put some values and click a button to calculate.

Attempt to reference field of non-structure array.

Error in untitled>oblicz_Callback (line 81)
v = get(handles.wprowadz, 'String');

Error in gui_mainfcn (line 96)
    feval(varargin{:});

Error in untitled (line 42)
gui_mainfcn(gui_State, varargin{:});

Error in @(hObject,eventdata)untitled('oblicz_Callback',hObject,eventdata,guidata(hObject))


Error while evaluating uicontrol Callback
Was it helpful?

Solution

That's because you're not supposed to open a GUI via the *.fig file, but via the associated *.m file, which contains the code to correctly open the *.fig file, with all the associated callbacks.

So if you want to run your GUI, either open the *.fig file through GUIDE as you currently do, or run the corresponding *.m file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top