Display format for table and matrix in live script

조회 수: 121 (최근 30일)
byungkeuk cho
byungkeuk cho 2019년 11월 22일
댓글: David Beedie 2024년 1월 8일
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.
  댓글 수: 1
David Beedie
David Beedie 2024년 1월 8일
disp() eliminates the row numbers:
rowNames = {'row1'; 'row2'; 'row3'};
Column1 = [1; 2; 3];
Column2 = [4; 5; 6];
T = table(Column1, Column2, 'rowNames', rowNames)
disp(T)

댓글을 달려면 로그인하십시오.

채택된 답변

Song-Hyun Ji
Song-Hyun Ji 2019년 11월 25일
편집: Song-Hyun Ji 2019년 11월 26일
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.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2019년 11월 22일
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
byungkeuk cho
byungkeuk cho 2019년 11월 22일
Thank you for your answer.
sym(A) is not what i want.
This is the format i want.
1.jpg
And concerning table, if you say so, i would like to find another function that helps to visualize a table in the live script.
Walter Roberson
Walter Roberson 2019년 11월 22일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by