How can I write N-dimensional numeric array into excel sheet?

I have a 1x120x289 numeric array (attached) that I want to write the different 289 pages into 289 different colomns in one excel sheet. Your help is appreciated.
Thanks!

 Respuesta aceptada

KSSV
KSSV el 17 de Mzo. de 2022
Editada: KSSV el 17 de Mzo. de 2022
Why you want to write it in different pages? You can write in a single sheet; so that it woul dbe easy while reading. LEt A be your 1X120X289 data array.
A = squeeze(A) ; % this will change 1X120X289 to 120X289
xlswrite('test.xlsx',A) ; % write data to excel file
% REad the file
A = readmatrix('test.xlsx') ; % your A would be 120x289, you can access each column now

3 comentarios

Thank you so much. I was referring to the third dimension, I thought it's called a page (r- by c- by p).
I'm using MATLAB 2018a, so write2table is not a defined function. I tried using writetable but I got an error of "Undefined function 'write' for input arguments of type 'double'."
Ohh..yes, there is type error. A matrix cannot be written using writetable. You can use xlswrite. Edited the answer.
It works now. Thanks again bro.
Much appreciated.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 17 de Mzo. de 2022

Comentada:

el 17 de Mzo. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by