Matlab은 현재 폴더의 모든 Excel 파일 이름을 가져 와서 인쇄합니다.

Matlab은 현재 폴더의 모든 Excel 파일 이름을 가져 와서 인쇄합니다.

1. 프로그램을 실행하면 다음과 같은 결과가 나옵니다.

여기에 사진 설명 삽입

2. 소스 코드

clear,clc
tic
xls_list = dir('*.xlsx');                            %   获取所有原始xls文件
xls_num = length(xls_list);                         %   xls文件总数量
xls_names=cell(xls_num,1);                          %   所有xls文件名称,含后缀名。
disp('所有xlsx文件名称依次为:');
for batch_i=1:xls_num    
	xls_names{batch_i}=xls_list(batch_i).name;
	fprintf('%2d %s\n',batch_i,xls_list(batch_i).name);          %   显示所有xls文件名称        
end
clear xls_list
time_batch_eachs=zeros(xls_num,1);
warndlg('          任务完成!',' ');

추천

출처blog.csdn.net/peter_young1990/article/details/114412012