When I open the GUI by 'run'-ning the code, it runs but when I open the GUI from the .fig file and run it, it gives me error

The error I'm getting is 'Attempt to reference field of non-structure array' for one of the inputs I'm supplying through GUI. Thanks in advance for your help.

 Accepted Answer

Anik - the GUI is not meant to be run/executed by double-clicking on the *.fig file. It can be run by calling (from the Command Window) the name of the GUI, or it can be executed in the MATLAB editor by pressing the run button (when editing the *.m file), or it can be executed from GUIDE.
When you just double-click the *.fig file, it is only the figure that will be displayed (much like the figure that is the result of plotting data) and none of the necessary initializations will occur.

More Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!