Can I save calculations performed in App Designer to the workspace?

조회 수: 5 (최근 30일)
danbro
danbro 2017년 2월 10일
답변: Thomas Fournier 2021년 8월 11일
Hi, I am creating an application which performs calculations based on user inputs and plots it on a graph. I would like to add a button that saves or exports the graph data to the MATLAB workspace (alternatively save it as a .mat file in a specified directory). Any ideas on how to do this? /danbro
  댓글 수: 2
danbro
danbro 2017년 2월 10일
I figure it out based on another thread with a similar question. I first declared a variable inside a private property and then used the function assignin() in a callback to generate the calculations to the workspace.
Stetson Spencer
Stetson Spencer 2018년 11월 21일
Hey would you mind sending me a link to the thread. I have a similar question also

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

답변 (1개)

Thomas Fournier
Thomas Fournier 2021년 8월 11일
You can use the command "assignin"
for exemple, here is a button's callback that send all the app data to the workspace:
function Send2workspaceButtonPushed(app, event)
assignin("base","app",app);
end

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by