フィルターのクリア

How to export data from a GUI to Matlab Workspace?

7 ビュー (過去 30 日間)
Fa'
Fa' 2012 年 9 月 6 日
Hi all, I have to export data from a GUI to Matlab workspace. Anyone can help me? Thanks.

回答 (4 件)

Image Analyst
Image Analyst 2012 年 9 月 6 日
You probably don't need to, or shouldn't need to, but if you insist, you can use the assignin() function. See the help for examples.

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 9 月 6 日
you can insert in each function concerned with x y z data the below code
global x y z
you also must run it before, on Matlab Command

Fa'
Fa' 2012 年 9 月 6 日
I'm sorry, probably I've not explain well my problem.
I'm programming a GUI and I've to export variable from my GUI to matlab workspace or I've to save variables as .mat but I don't know which command can do this...
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 9 月 6 日
save FileName x y z %save to mat file

サインインしてコメントする。


Matt Fig
Matt Fig 2012 年 9 月 6 日
In the code of the GUI, when you want to export the variables do:
save guioutput
This will save all of the variables in the local workspace to a file named guioutput.mat.
Then from the command line do:
X = load('guioutput');
Now X is a structure with fieldnames the same as the variable names you saved.
If you need to do something more specific, then ask a more specific question...
  2 件のコメント
Fa'
Fa' 2012 年 9 月 6 日
Thanks, now it's ok, the variable is saved in the pathway where I'm working. If possible I want to save the variable in another pathway and with another name. Can you suggest me something to do this? Thank you very much for your attention.
Matt Fig
Matt Fig 2012 年 9 月 6 日
You can specify where to save the variables and the name of the file. Read this:
doc save
for example:
save('C:\Users\matt fig\Documents\MATLAB3\mvars')
saves all the variables in the local workspace to myvars.mat in the MATLAB3 folder.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by