フィルターのクリア

How to display a table object in command window in a different color

2 ビュー (過去 30 日間)
Daniel Lemus
Daniel Lemus 2017 年 8 月 9 日
回答済み: Jan 2017 年 8 月 9 日
Hi
I am working with tables and I was wondering how to display the table in a different color. I know you can use the cprintf function for regular strings but it doesn't work if I try to pass an object table.
Ideally it should be something like this
MyTable = table (1, 2, 3)
disp(MyTable,'r')

採用された回答

Jan
Jan 2017 年 8 月 9 日
There is no direct way. You have to create a string at first, e.g. using evalc('disp(MyTable)').
This suffers from the same problems as eval and assignin, but if you do not use this to create variables, but catch the string output only, there is a chance that it does not make your code evil.
Are you really sure that this is useful? What about the output to a specific GUI? The command window has very limited possibilities only, and squeezing them might not be useful. As soon as more sophisticated output is required, a HTML display in a GUI might be smarter at all.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by