Tables in Live Editor not consistent
2 次查看(过去 30 天)
显示 更早的评论
Hello:
I'm coding a program using the Live editor and at the end of it I had a surprise.
Along the program the tables displayed properly like the following image, using this command
array2table(ema25n)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1569492/image.png)
But at the end of the script I'm getting this useless output, using the same command:
array2table(ref_n_2,"VariableNames",["N1","N2","N3","N4","N5"])
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1569497/image.png)
And both are generated with the same command:
array2table()
But the result is completely different.
I'm using the latest Matlab (2023b) in a MacBook Pro M1.
I restarted the program several times (I found it solves other problems like graphics in Live Editor), but it doesn't work for thi kind of problem of the output format of the tables.
0 个评论
回答(2 个)
Sulaymon Eshkabilov
2023-12-15
Your output is correct, e.g.:
MAG5 = magic(5);
D1 = array2table(MAG5)
D2 = array2table(MAG5, 'VariableNames',["C1", "C2", "C3", "C4", "C5"])
2 个评论
Dyuman Joshi
2023-12-15
The question is not about the values but how the output is displayed. You can see the difference of how tables are displayed in the 2 images shown in the problem description.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!