get the name of mat file loaded by command "uiopen" ?

조회 수: 5 (최근 30일)
Brasco , D.
Brasco , D. 2014년 6월 13일
댓글: Junho Kweon 2019년 3월 20일
hi guys,
let say i got more than 5 mat files in my current directory and i am using " uiopen " to select one of them.
abcde.mat
qwert.mat
ghgdsfs.mat ....
i also need to get the name of the loaded mat file. ('abde.mat' or the one whic is selected )
is there any way to get the name of loaded mat file with out saving it with a different name or etc.
thanks for help
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2014년 6월 13일
Maybe you mean the names of your variables
Brasco , D.
Brasco , D. 2014년 6월 13일
no i watn the name of the mat file. not the variables in it.

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

답변 (3개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 6월 13일
편집: Azzi Abdelmalek 2014년 6월 13일
[file,path]=uigetfile('*.mat','select a amt file'),
filename=fullfile(path,file)
  댓글 수: 1
Junho Kweon
Junho Kweon 2019년 3월 20일
I like this way. Sometimes, I need to load files which are in different location.
Thanks for your idea :)

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


Dishant Arora
Dishant Arora 2014년 6월 13일
Use uigetfile instead.
fileName = uigetfile('*.mat');
load(fileName)

Joseph Cheng
Joseph Cheng 2014년 6월 13일
How are you selecting them? GUI, hard coded, determined by set of parameters, etc? because since you're using uiopen you are putting a string into the function which you could have set that into a variable before.
example:
%%you've hard coded
uiopen('abcde.mat');
%%could have been implemented as
LoadedMatName_1= 'abcde.mat';
uiopen(LoadedMatName);
So it all depend on how you're selecting the files. if it is user input you can store the selected one when they choose but how to implement depends on how you let the user select the file.
  댓글 수: 1
Brasco , D.
Brasco , D. 2014년 6월 13일
i am using
uiopen ('mat')
thats it. just loading the selected mat file. nothing more.

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

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by