export matrix into Excel

37 visualizaciones (últimos 30 días)
Rebecca Hadley
Rebecca Hadley el 19 de Feb. de 2019
Comentada: Jesus Sanchez el 4 de Mzo. de 2019
Hi,
I'm trying to export a matrix called xyzCGAT into Excel (three columns and 60480000 rows for each column). I've tried using xlswrite (code below) and it produces the error:
Error using xlswrite (line 172)
Input data must be a numeric, cell, or logical array.
Error in conversion_to_excel (line 5)
xlswrite(filename,A);
The values within the matrix are acceleration values and some are negative so therefore include a minus symbol infront of the value. Is this causing the issue?
Any advice about where I'm going wrong or how to convert such values to an Excel file would be really appreciated. Thanks in advance!
load xyzCGAT.mat
A = table (1,2,3)
A(:,1:3)
filename= 'xyzCGAT.xlsx'
xlswrite(filename,A);

Respuesta aceptada

Jesus Sanchez
Jesus Sanchez el 19 de Feb. de 2019
Editada: Jesus Sanchez el 19 de Feb. de 2019
xlswrite only works with matrixes and you created a table. You are looking for the function called "writetable"
PS: As you are working with tables, it is possible to call each row of the table with a name, which later on will also be saved to the excel file, txt file or whichever you want. In the link provided above there are good examples of that.
EDIT: An example in your code:
writetable(A,filename);
  8 comentarios
Rebecca Hadley
Rebecca Hadley el 3 de Mzo. de 2019
Hi,
Thanks for the additional advice! I tried to give it a try on a different computer and I got the following error (unrelated to the actual code I believe):
Out of memory. Type HELP MEMORY for your options.
I tried using the memory function and got the following information:
Maximum possible array: 26643 MB (2.794e+10 bytes) *
Memory available for all arrays: 26643 MB (2.794e+10 bytes) *
Memory used by MATLAB: 2964 MB (3.108e+09 bytes)
Physical Memory (RAM): 8103 MB (8.497e+09 bytes)
Is anyone able to help me interpret what it is telling me?
Jesus Sanchez
Jesus Sanchez el 4 de Mzo. de 2019
Hello,
please create a new and separate topic for this. I am not sure of that error and, as this is a question that already has an answer, it will not appear for that many people

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by