adding color in command-window output...

290 views (last 30 days)
Kip
Kip on 7 Sep 2011
Commented: DGM on 24 Apr 2024 at 7:51
I use fprintf to report results in the command window. I know I can report errors or warnings, and they display in red or whatever.
I'd like a general tag for fprintf to select colorized text output. I haven't seen any option in the documentaion; is it possible?
Any help would be appreciated.
  2 Comments
Sai Anjan Kumar
Sai Anjan Kumar on 24 Apr 2024 at 6:57
This comment was flagged by DGM
black image coming
DGM
DGM on 24 Apr 2024 at 7:51
What does that mean?

Sign in to comment.

Accepted Answer

Sean de Wolski
Sean de Wolski on 7 Sep 2011
Built-in, the only way I know of is to make it red:
fprintf(2,'\nHello world\n')
use 2 as the fid.
However, Yair's cprintf claims to be able to do it.
  1 Comment
Minh Vu
Minh Vu on 30 May 2023
After using this command, how can I reverse back to the original setting?

Sign in to comment.

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!