필터 지우기
필터 지우기

Capture file name from uiimport function

조회 수: 3 (최근 30일)
Anthony Mittas
Anthony Mittas 2011년 6월 15일
I would like to use the filename string of the file that I choose when I use the uiimport function. I am sure that Matlab stores the string somewhere but I don't know how t find it.

답변 (1개)

Chirag Gupta
Chirag Gupta 2011년 6월 15일
Well it stores it internally (its buried in the code). You can check the code by typing edit uiimport. uiimport does not really output the filename selected and I wouldn't recommend changing the code in there before backing up.
An alternative solution might be:
[filename,path] = uigetfile; % opens up a similar dialog to uiimport to select a file
uiimport(fullfile(path,filename)); % directly imports the selected file
doc uigetfile
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 6월 15일
I looked myself, and as best I can tell the filename is not usually made available. In a subset of cases, you can get traces of it by looking at the field names of the structure returned, but that is unreliable and incomplete and does not apply for all the file types that are supported.

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

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by