MATLAB Answers

0

Getting output from GUI

Asked by Edward Sullen on 25 Feb 2019
Latest activity Commented on by Alexandre Cucatti dos Santos on 27 May 2019 at 14:26
I've created a GUI usind guide. I would to know how to output something from this GUI and immediately close it when a certain pushbutton in it is pushed.

  2 Comments

what outputs are you looking? An image, A numeric variable, A figure? Where do you want to store the output?
I want to output two matrices that I calculate once the button is pressed. I want to store these matrices in variables in the workspace.

Sign in to comment.

Products


Release

R2017b

1 Answer

Answer by Kevin Chng on 25 Feb 2019

Assume you know how to pass those data between the function in guide.
In the callback of your button, if val1 is your matrix, you want assign it to the workspace and name this variable in the workspace as 'test1'.
assignin('base','test1',val)

  2 Comments

Thanks for that, but I wanted to use varargout or assign another output variable. The GUI executes the OutputFcn before it executes any Callback, so I don’t have the chance to update the handles structure nor the varargout.
I had a similar problem, this video helped me a lot:
hope it helps you too :)

Sign in to comment.