필터 지우기
필터 지우기

GUI, workspace

조회 수: 3 (최근 30일)
john
john 2012년 4월 10일
Hi,
how can I create any pop up window for save variable for example to "a.mat" , and any pop up window to load variable from the list, from witch I can set .mat file...
please help and thanks for every ideas

답변 (2개)

Geoff
Geoff 2012년 4월 10일
You could use uiputfile to select a file name to be created:
doc uiputfile
(If you want to get a file to load, use uigetfile)
But there is actually a command called uisave which saves variables from the workspace. You just need to tell it what...
doc uisave
To get the variable names from the workspace, use whos:
vars = whos;
Interestingly, you can also do this on an existing .mat file, if you want to choose what to load back later:
vars = whos('-file', 'yourdata.mat');
For list boxes, you need a uicontrol
doc uicontrol
You might want to use GUIDE to help you creating a user interface if you are not comfortable with MatLab or UI programming in other languages.
guide
This is also worth a read:
  댓글 수: 2
john
john 2012년 4월 11일
Hi,
and how can I create popup window, for example like with command "uiputfile" I create popup window- of course more easier :-)...
.
.
.If I create popup window ( if I press any button) and then I load any variable from workspace, so this variable will be available also for parent window? If is not available, how can I make this available for parent window?
Thank you
Geoff
Geoff 2012년 4월 11일
For your GUI, you need to work through this: http://www.mathworks.com.au/help/techdoc/creating_guis/bqz6p81.html
Yes, you can create a popup GUI, but it takes a bit of code. Use GUIDE to help you with the basics, then just link up the events.
To get variables from the base workspace from within a function, use this: evalin('base', 'whos')

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


Image Analyst
Image Analyst 2012년 4월 12일
You might look at uipickfiles. Either use it as-is, or study it to see how it's done: http://www.mathworks.com/matlabcentral/fileexchange/?term=uipickfiles

카테고리

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