How to pass gui output to workspace?

18 visualizaciones (últimos 30 días)
Curious Mind
Curious Mind el 20 de Jul. de 2020
Comentada: Stephen23 el 23 de Jul. de 2020
Hello, I am trying to develop a gui using matlab app designer. 1. How do I write the code such that the output of a push button appears in the workspace? 2. I used the property tool to share data across but for some reason this only works if the output is physically present in the workspace. The output is a structure called F. How do I correct this? I am using evalin(‘base’, ‘F’) in the property section. If I can find a way to make the output appear in the workspace then the app will work fine.
Thank you
  2 comentarios
Roger J
Roger J el 21 de Jul. de 2020
I was able to create and write to a variable in the base workspace using the following:
% Button pushed function: Button
function ButtonPushed(app, event)
str = sprintf('%s called (%s)',"ButtonPushed",char(datetime));
assignin('base','myF',str)
end
"ButtonPushed()" is the callback for a button.
Let me know if it works for you.

Iniciar sesión para comentar.

Respuesta aceptada

Anirudh Singh
Anirudh Singh el 23 de Jul. de 2020
You can use "assignin" function to store data in the workspace either 'base' or 'caller' depending upon your requirements.
For more information check the documentation link for "assignin" function: https://www.mathworks.com/help/matlab/ref/assignin.html

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by