Store MATLAB app designer variables to work-space

Hi. How we can store app designer variables to MATLAB R2016a main window work-space. We have this behavior in GUIDE. There I can't find any connection between app designer and work-space of MATLAB.

 채택된 답변

Sean de Wolski
Sean de Wolski 2017년 1월 12일

4 개 추천

You could use assignin or export2wsdlg.

댓글 수: 3

Can you please provide a simple example? For example if I want to change a variable using Appdesigner and wants to store it in the workspace, how can I do that using the above commands?
Example of assigning output to base workspace after pressing a button:
function ButtonPushed(app,event)
x = 10;
assignin('base','x',x);
end
Hello,
For variable Its easy but what If I need to output data from the GUI to the struct,which already present in the workspace?

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

qmnjb007
qmnjb007 2018년 1월 12일
편집: qmnjb007 2018년 1월 12일

2 개 추천

Here's a link to the matlab page on sharing data within apps that has sample solutions.
Chris Portal
Chris Portal 2016년 4월 10일

1 개 추천

Jack, I can imagine a few scenarios why I might need to do this, but I'm curious to hear yours. Can you share why you're looking to store your App Designer variables outside your app? Is it to troubleshoot something or for some other purpose?

댓글 수: 2

Typical... I can imagine a 1000 different reasons to do this. Why exactly is the workspace outside of the App designer?
I am looking for an answer for the original post. I need this so I can design a GUI for a 6DOF aircraft simulation in simulink. I want the user to define his inputs into the gui, and once a button is pushed I want the related m file aswell as the simulation to run using the variables defined by the user.

댓글을 달려면 로그인하십시오.

Armen Ghambaryan
Armen Ghambaryan 2017년 1월 12일

0 개 추천

You can save variable in .mat file and then load it from workspace.

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

질문:

2016년 3월 20일

댓글:

2021년 8월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by