Export part of the matrix to excel

4 visualizaciones (últimos 30 días)
Natasha Elizabeth Francis
Natasha Elizabeth Francis el 18 de Jun. de 2022
Respondida: Animesh Gupta el 10 de Oct. de 2022
I understand that a matrix output could be exported to excel using the writematrix command. But it has a limit when it is a large matrix. I got the following error 'The data block starting at cell 'A1' exceeds the sheet boundaries by 0 row(s) and 249744 column(s)'. Is it possible that I can extract part of the matrix to excel in matlab?
  1 comentario
Image Analyst
Image Analyst el 18 de Jun. de 2022
What is the size of your matrix, and what section do you want to extract and export to Excel?
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

Iniciar sesión para comentar.

Respuestas (1)

Animesh Gupta
Animesh Gupta el 10 de Oct. de 2022
Hello,
It is my understansing that you want to extract part of the matrix and export it to excel.
The interested part of the matrix can be extracted by using square brackets and then extracted using writematrix.
You may refer the following script to understand the procedure
arr = rand(1024,100024);
writematrix(arr([1:100], [1:744]), 'out.xlsx'); % () are used for indexing and [] are used for truncation.
Please note that MATLAB supports .xls, .xlsm, .xlsx formats of excel to export to. Based on the upper limit of rows and columns, any of these can be chosen.
I hope it helps.

Community Treasure Hunt

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

Start Hunting!

Translated by