我是一个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的配置文件活动即可。 –