how can i change the colors of matrix rows ?
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
hi, i have build a matix. i have turned diary mode on ('diary on'). i wanna change just last row color of matix in output file. how? thank you.
採用された回答
dpb
2021 年 7 月 4 日
See the Limitations and Tips section of the doc for diary
Limitations
Because the output of diary is plain text, the log file does not exactly mirror what you see on screen:
- The diary file does not include graphics (figure windows).
- The diary file does not preserve syntax highlighting and font preferences.
- The diary file shows hidden components in the Command Window, such as hyperlink information generated with matlab:, in plain text. For example, if you enter this statement in the Command Windowstr = sprintf('%s%s', ...
'<a href="matlab:magic(4)">', ...
'Generate magic square</a>');
disp(str)
MATLAB displays
However, the diary file, when viewed in a text editor, shows
str = sprintf('%s%s', ...
'<a href="matlab:magic(4)">', ...
'Generate magic square</a>');
disp(str)
<a href="matlab:magic(4)">Generate magic square</a>
Tips
- To view the contents of the diary file with syntax highlighting, use the type function.
9 件のコメント
armin m
2021 年 7 月 5 日
So according to your answer in diary mode it is impossible. In which format can i do the mentioned above question? Tnx
dpb
2021 年 7 月 5 日
That's what the doc says, not me.
I don't have any idea; I use MATLAB to compute with, not for presentation, so I've never looked into any of the report generation stuff.
armin m
2021 年 7 月 5 日
Tnx
dpb
2021 年 7 月 5 日
I dunno if you were to echo a font color change or embed a TeX color code in the output the result with type would reflect that or not -- that would be only way I could see something might possibly happen with the output stream from diary; as the doc says, all it does is translate and echo what is in the command sequence it sees as the text; the command window display code isn't written to interpret output codes for presentation, it just echoes ASCII characters; only if there is a hardware/software interrupt on a given control string like the linefeed, etc., that is in default terminal display io will those limited control characters be recognized.
armin m
2021 年 7 月 5 日
I do not fully understand what u said. I just want show one row of matrix with different color in command window and exported file.
See the Tip comment above about type -- it has the facility to draw at least some of the embedded formatting information on the screen when it processes a diary file, but the builtin command window output code simply doesn't have that ability.
"I just want show one row of matrix with different color in command window and exported file."
Well, sometimes we just can't have everything we want. The command window isn't set up to do that; it was a product from 40 years ago when such niceties were unheard of and still is the interface to enter user commands and see output interactively, but is not designed nor intended to be a presentation manager. TMW has products for that purpose specifically or you can export to other formats that do have the facility, but not at the command window.
The new intereactive editor may have some additional facilities; I dunno about that; I've also never used it nor even opened it up as it simply isn't what I'm into with MATLAB. Maybe somebody else will add some other ideas.
Text files also are just that--text files; it takes something like html or other formatting code to produce such effects and then a specialized program to read the file and interpret those commands to put "the right stuff" on the screen. That tool just isn't the command window in MATLAB, sorry.
armin m
2021 年 7 月 6 日
Thank you for full explanation and the time you spent.
dpb
2021 年 7 月 6 日
No problem...another way to think of it is it's why there is the Interpreter property for text and tick labels, or why need Adobe Reader for pdf files (and why need .pdf and TeX or LaTeX, etc., etc., ...)
armin m
2021 年 7 月 6 日
Ok.very good.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Entering Commands についてさらに検索
参考
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
