Export table from Live Script (formatting problem)
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Stu Pgmmr
el 26 de Nov. de 2024
Comentada: Stu Pgmmr
el 13 de Dic. de 2024
I create multi-column tables in LiveScript but when I export to *.pdf or *.doc files only the first column seems to be exported (see Exported_file.jpg). Is there some formatting command I am missing?
LiveScript code:
- clear all
- close all
- clc
- T = table(rand(5,5))
1 comentario
Image Analyst
el 26 de Nov. de 2024
Editada: Image Analyst
el 26 de Nov. de 2024
Exactly what steps did you do to create the PDF output?
Respuesta aceptada
Sandeep Mishra
el 28 de Nov. de 2024
Hi Stu,
I ran the provided code in MATLAB R2024b and encountered the similar issue while generating the pdf using ‘Export to pdf’ button.
The table generated by the code has 5x1 dimension instead of 5x5 dimension and hence the pdf was not getting generated correctly.
You can refer to the following code snippet to generate a 5x5 table:
data = rand(5, 5);
T = table(data(:, 1), data(:, 2), data(:, 3), data(:, 4), data(:, 5), ...
'VariableNames', {'Column1', 'Column2', 'Column3', 'Column4', 'Column5'})
For more information, refer to the following MathWorks Documentation to learn about ‘table’ function: https://www.mathworks.com/help/releases/R2024b/matlab/ref/table.html#btw1wrc-3
2 comentarios
Peter Perkins
el 1 de Dic. de 2024
As Sandeep hints at, you likely wanted array2table(rand(5,5)), not table(rand(5,5)).
Más respuestas (0)
Ver también
Categorías
Más información sobre Tables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!