필터 지우기
필터 지우기

Save data in excel

조회 수: 1 (최근 30일)
Jadiel Silva
Jadiel Silva 2013년 12월 15일
댓글: Azzi Abdelmalek 2013년 12월 17일
Hello I am new to matlab and would like your help. I have a program that reads the file. Mat. When I read that file to transform vector data matrix and so I need to save it in excel. But I have 50 files. Mat and need to save all vectors one after another in excel so they become a single vector in excel. I greatly appreciate any help.
  댓글 수: 8
Image Analyst
Image Analyst 2013년 12월 16일
Can Excel handle 12.5 million rows? If it can, I agree with Azzi, just concatenate them all in MATLAB, then call xlswrite() just once with the 12.5 million element vector.
Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 16일
편집: Azzi Abdelmalek 2013년 12월 16일
I don't think Excell can handle 12.5 millions rows.It's better to save each matrix in different sheet

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 15일
편집: Azzi Abdelmalek 2013년 12월 16일
I don't know, why you want to save them all as one vector instead a matrix 2500x500. But if you want to save your data as a vector, load your data in your files, concatenate them in one vector v then write
xlswrite('file.xlsx',v)
To load your files, put all your 50 files in one folder, for example D:\yourfolder. If your array is named M in your files:
folder='D:\yourfolder'
d=dir('*.mat')
for k=1:numel(d)
data=lod(d(k).name);
M=data.M;
v=[v;M(:)];
end
xlswrite('file.xlsx',v)
  댓글 수: 5
Jadiel Silva
Jadiel Silva 2013년 12월 17일
Hello people. Excuse me, but I need your help again. I'm so ashamed of my ignorance in matlab. I ran the code:
folder='D:\vetor'
d=dir('*.mat')
for k=1:numel(d)
data=lod(d(k).name);
APDI=data.APDI;
v=[v;APDI(:)];
end
but every time I call the function:
xlswrite('file.xlsx',v)
show the message: ??? Undefined function or variable 'v'.
Personal excuse me for being even bothering both you guys with my ignorance in matlab, but the help of you have been very valid and I thank you immensely.
Please can you help me?
Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 17일
v should be initialized
folder='D:\vetor'
d=dir('*.mat')
v=[];
for k=1:numel(d)
data=lod(d(k).name);
APDI=data.APDI;
v=[v;APDI(:)];
end

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by