Saves App Properties in current state

조회 수: 9 (최근 30일)
Marcus Heßeling
Marcus Heßeling 2021년 6월 22일
편집: J. Alex Lee 2021년 6월 25일
In the App i use, i want to save the app properties from the Workspace in a mat-file. When i save it, not the current state but the default state is saved. Is there a way to save the current properties with all the changes made within the UIFigure ?
  댓글 수: 2
Mario Malic
Mario Malic 2021년 6월 22일
I have never tried doing such things, but I doubt someone who did would see this question. I could suggest you to try to save uiaxes handles to the file, and try with https://uk.mathworks.com/help/matlab/ref/savefig.html and https://uk.mathworks.com/help/matlab/ref/copyobj.html
However, I have never tried this.
J. Alex Lee
J. Alex Lee 2021년 6월 22일
Can you clarify if you mean you want to save an app state from the Matlab command line, versus save an app state from within a method of the app itself?
If Matlab command line, are you invoking the app with an output (to hold the app instance)? If not, I would think it is impossible to access the state of the app from outside.

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

답변 (1개)

Marcus Heßeling
Marcus Heßeling 2021년 6월 23일
The basic idea is this:
I set all the parameters in the App for a script i want to run. Then is press the Start Button in the App and in the function StartButtonValueChanged i want to save all app Properties in a file and then start the script. When the script is finished and its back to the app area, the app Properties need to be loaded again since they disappear while running the script.
The reason i run a script and dont copy the whole script in the app is because its a very huge script and changing it to run within the app would take days
  댓글 수: 3
Marcus Heßeling
Marcus Heßeling 2021년 6월 23일
ok sorry that im unclear. I want to save the app state within the function Startbutton, not with command line. I want so save the current properties in a .mat file , and then load them again. The problem is when i save the properties, not the current state is saved but the default values. So i need to find a way that the app properties are saved and loaded correctly, because after my script i want to interact with the app again, but when everything is set an default its not possible
J. Alex Lee
J. Alex Lee 2021년 6월 25일
편집: J. Alex Lee 2021년 6월 25일
maybe you can post a minimum working code example of what you mean.

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

카테고리

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