Disp(...) - How to do only ONE word in bold/underlined letters
205 ビュー (過去 30 日間)
古いコメントを表示
Marcel Langner
2018 年 11 月 28 日
コメント済み: Walter Roberson
2021 年 5 月 28 日
Hi,
I want to Display a text which shall look for Example like this:
Hello World!
How to do that? I know it is possible to put a whole text in bold, but is it possible also to put just one word of the sentence in bold?
Thanks
3 件のコメント
madhan ravi
2018 年 11 月 29 日
I want to display it in the command window
Not here :-)
madhan ravi
2018 年 11 月 29 日
採用された回答
Walter Roberson
2018 年 11 月 29 日
7 件のコメント
Walter Roberson
2018 年 11 月 29 日
Bold cannot be done without magic.
Glancing at the current version of the code I am not sure bold is even supported at the moment.
What can be done without magic is underlining, such as
fprintf('Will you say <a href="">hello</a>\n')
which will output the hello underlined.
Also without magic you can emit red, with slightly more work:
fprintf('Will you say '); fprintf(2, 'hello\n')
The extra work here is that you need to fprintf() to unit 2 only for the text that is to be red.
その他の回答 (1 件)
Peng
2019 年 8 月 8 日
why don't you use <strong> </strong> pair?
disp('Hello, <strong>World</strong>!');
参考
カテゴリ
Help Center および File Exchange で Argument Definitions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!