![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1585701/image.png)
Display format for table and matrix in live script
84 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
byungkeuk cho
le 22 Nov 2019
Commenté : David Beedie
le 8 Jan 2024
Hi,
I am trying to write a report with live script editor.
but I have a very simple question.
First, I would like to eliminate the number of row index as shown below.
(1 Row1 is not what i want)
Second, I would like to display a matrix with a bracket.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249506/image.jpeg)
1 commentaire
David Beedie
le 8 Jan 2024
disp() eliminates the row numbers:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1585701/image.png)
rowNames = {'row1'; 'row2'; 'row3'};
Column1 = [1; 2; 3];
Column2 = [4; 5; 6];
T = table(Column1, Column2, 'rowNames', rowNames)
disp(T)
Réponse acceptée
Song-Hyun Ji
le 25 Nov 2019
Modifié(e) : Song-Hyun Ji
le 26 Nov 2019
About the first question, unfortunately there is no way to remove row numbers for the table in the Live Editor. We will consider creating a feature to turn off the default row numbers when row names are provided.
About the second question, please refer to the following article.
0 commentaires
Plus de réponses (1)
Walter Roberson
le 22 Nov 2019
table() is not designed for display purposes. To customize it, you pretty much need to use Report Generator.
How would you like the brackets around the array to look?
>> sym(A)
ans =
[ 1, 2, 3]
[ 4, 5, 6]
Or you could create "ASCII Art" that might look something like
+- -+
| 1, 2, 3|
| 4, 5, 6|
+- -+
A routine would have to be written to do this.
2 commentaires
Walter Roberson
le 22 Nov 2019
You would need to draw the brackets using plot() and text() the numbers into place. Or you could use Computer Vision insertText and insertShape to create images that you displayed.
If your hope is display those kinds of formatted items at the command line, then you will need to wait for some later release, or hack the display mechanism.
Voir également
Catégories
En savoir plus sur LaTeX dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!