MATLAB: Xlswrite multidimensional array in one sheet.

3d arrayxlswrite

I tried to export 6 x 6 x 1000 matrix from matlab to exel. However, the xlswrite overwrite it.
I used the following loop to resolve the issue
for j=1: length(Matrix,3)
xlswrite('xlsName.xls',Matrix(:.:,j),j)
end
But, it print the new data to the new sheet and it is not what I wanted.
Any help is appreciated!.
Thanks

Best Answer

This works, in any case if someone need it
T=matrix ;
for j=1:length(matrix)
T(8*(j-1)+[1,dim(matrix)],:)=matrix(:,:,j)
end
xlswrite('filename',T,'sheetname','B2')