Saving base workspace to .mat file multiple times in GUIDE GUI

조회 수: 3 (최근 30일)
Henry
Henry 2013년 7월 4일
Hi,
From looking at previous threads, I've seen how you save the workspace to a file (thank you Jan Simon) but I was wondering if you could do this more than once.
I would like my user to be able to change a load of variables in the GUI, and if they like the outputs, be able to save that data to an .mat file. Then, if they have another fiddle and want to save some more data, it would save to a seperate .mat file.
Is this possible? Or is there a quick trick to writing the code to make it work elegantly?
Thanks,
  댓글 수: 2
Matt J
Matt J 2013년 7월 4일
Do you really mean "save it to a .mat file"? A .m file is a file containing code, not data.
Henry
Henry 2013년 7월 4일
Yes, sorry, I'll edit the question.
thanks

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

채택된 답변

Guru
Guru 2013년 7월 4일
Yes it's possible.
All you really need is to have a means to choose what to name your MAT-file from your GUI.
This can be done by having an Edit textbox control in your GUI, or using some other means with the UI controls to prompt the user for a filename.
  댓글 수: 4
Henry
Henry 2013년 7월 5일
the edit26 box is the box i want the user to input the name s/he wants the mat file to be called.
i want to save the whole base workspace rather than the handles individually, as there's a large amount of editable (through the GUI) in the workspace along with other uneditable data and variables whos values depend on both these sets of data.
So the user can load all his/her previous data easily for future use.
Thanks for the help
Guru
Guru 2013년 7월 6일
Well place the save command code I put in the previous comment with your evalin commands. That should work.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by