MATLAB: Import data in GUI

data importgui

Hello, I have to work with GUIs and I have to import some values from mfile. For exemple, I have solve.m file which contains some ecuations and I want to display value of "Power" result in an edit text. Please tell me how can I do this. Thanks!

Best Answer

Assuming solve.m is your file that creates variables, you can call solve.m from your main script to create your variables in the base workspace and then use them in your main script. Like main.m would look like
solve(); % Create and load/import variables into base workspace.
% Now do something, for example, display power in an edit text field
handleToEditText.String = Power; % Or sprintf('%f', Power);