display different colors in command window, using command "disp" or similar

조회 수: 267 (최근 30일)
Per
Per 2013년 1월 25일
답변: Chunguang LI 2021년 4월 20일
I want sections of my display to be in differnt colors. (Matlab 2009)
ex:
disp('Hello matlab Central!')
Is it possible to get that text in example red?
disp('Hello matlab Central','red')
Thanks
  댓글 수: 1
Ronald Hartwig
Ronald Hartwig 2018년 10월 27일
Apparently not. With more current version, simple things like cprintf and fprintf are not valid either.

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

답변 (2개)

Chunguang LI
Chunguang LI 2021년 4월 20일
fprintf(2,'only red\n'); %2 for standard error.

Evgeny Pr
Evgeny Pr 2013년 1월 25일
Use cprintf function.
This is an undocumented feature!

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by