필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

can anybody help me with matlab coding+excel??

조회 수: 1 (최근 30일)
Sony
Sony 2013년 5월 29일
마감: MATLAB Answer Bot 2021년 8월 20일
I have got many files lets say 30 files ,in each file there are 3 columns of data but the no: of rows varies for each file .for eg 1 file has got 6 rows and 3 columns then next file has 3 rows and 3 columns etc .i was not able to append it since its size varies.i need 2 write all these data in an excel sheet also . pls help me??

답변 (2개)

David Sanchez
David Sanchez 2013년 5월 29일
N_files = 30;
for k = 1:N_files
file_name = strcat('name',num2str(k));
file_name = strcat(file_name,'.xls');
data{k} = readxls(file_name);
end
You will end up with a cell array, whose cells content may be of different size. Later, you can handle this data as you please, even write it all to a single xls file
  댓글 수: 1
Sony
Sony 2013년 5월 29일
sorry i dint understand wat u said

Image Analyst
Image Analyst 2013년 5월 29일
Can you use csvread() or dlmread() plus the FAQ to read each file into a matrix? Append all the individual matrices together into one big matrix. You can append them vertically as long as they all have 3 columns.
allData = [];
for k = 1 : number of files
% Make sure you change filename at each iteration.
fullFilename = fullfile(folder, files{k}.name);
dataFromOneFile = csvread(fullFilename );
allData = [allData; dataFromOneFile];
end
Then send that matrix out to Excel using xlswrite().

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by