Export an array of data from matlab to excel

1

I have a file with multiple arrays, as described:

Name          Value
lat           <162x168 single>
lon           <162x168 single>
obsData       <162x168x4929 double>
time          <5844x3 double>
v6Data        <162x168x4929 double>
v7Data        <162x168x4929 double>

I want to send this data to excel or cvs. I tried several unsuccessful commands. Has anyone done this export?

    
asked by anonymous 28.04.2017 / 19:31

1 answer

1

Hello

Using matlab R2015a you can use this command to save 2D arrays:

xlswrite('NomeDoArquivoXLS', matriz);

Some of your arrays have 3D. In this case the matrices can be saved in the same file only in different worksheets. Example:

A = zeros(20, 10, 3); 
for i = 1 : size(A,3),
    A(:,:,i) = A(:,:,i) + i;
    xlswrite('NomeDoArquivoXLS', A(:,:,i), i); 
end

The last parameter of the function xlswrite is the worksheet number.

    
06.06.2017 / 15:51