How to select multiple excel files with the uigetfile function?

조회 수: 1 (최근 30일)
enzo Boven
enzo Boven 2022년 1월 24일
댓글: Jon 2022년 1월 24일
I used the uigetfile function in order to select excel files. I also used the Multiselect option, however when I run the program and need to select the excel files, it is not possible to select two or more excel files. While it is possible to select only one file. How can I fix this problem?
used script:
[file_list,path_name] = uigetfile('.xlsx','MulitSelect','on');
if iscell(file_list) == 0
file_list = {file_list};
end
for i = 1:length(file_list)
filename = file_list{i};
data_in = xlsread([path_name, filename]);
x_rf_raw = data_in(:,9); %9 relative xrf data else 1
y_rf_raw = data_in(:,10); %10 relative yrf data else 2
x_s_raw = data_in(:,12); %12 relative xs data else 5
y_s_raw = data_in(:,13); %13 relative ys data else 6
% analysis ....
end

답변 (1개)

Jon
Jon 2022년 1월 24일
편집: Jon 2022년 1월 24일
[file_list,path_name] = uigetfile('*.xlsx','MyDialog','MultiSelect','on');
You were missing the dialog name argument, so it was using 'MultiSelect' as the dialog name
  댓글 수: 2
Jon
Jon 2022년 1월 24일
If this answered your question, please accept the answer so others that have a similar question will know an answer is available

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

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by