나는 matlab에 초보자이며이 문제에 붙어있다. MATLAB 코드를 사용하여 여러 개의 Excel 파일에서 하나의 새 파일을 만들려고합니다. 새로운 파일을 생성 할 수있었습니다. 그러나 파일이 혼란에 빠졌고 나는 그것을 어떻게하는지 전혀 모른다. 코드는 다음과 같습니다.matlab를 사용하여 여러 excel 파일을 하나의 Excel 파일로 가져 오는 방법은 무엇입니까?
% Merge multiple XLS files into one XLS file
[filenames, folder] = uigetfile('*.xls','Select the data file','MultiSelect','on'); % gets directory from any folder
% Create output file name in the same folder.
outputFileName = fullfile(folder, 'rainfall.xls');
fidOutput = fopen(outputFileName, 'wt'); % open output file to write
for k = 1 : length(filenames)
% Get this file name.
thisFileName = fullfile(folder, filenames{k});
% Open input file:
fidInput = fopen(thisFileName);
% Read text from it
thisText = fread(fidInput, '*char');
% Copy to output file:
fwrite(fidOutput, thisText);
fclose(fidInput); % close the input file
end
fclose(fidOutput);
나는 결과 데이터가 얼마나 엉망인지 보여주는 그림입니다. 저 좀 도와 주 시겠어요? 고맙습니다.
동일한 질문을 반복해서 쓰면 아무 효과가 없습니다. OP의 프로필 활동을 살펴보십시오. –