필터 지우기
필터 지우기

producing colored letters in an if statement

조회 수: 1 (최근 30일)
salva
salva 2012년 7월 30일
Is there any way to display the warning ‘Do that’ in the below if statement in red colour so that it can stand out?
If
'Do that'
end
thanks
  댓글 수: 1
Jan
Jan 2012년 7월 30일
Do you mean inside the source code, when it is displayed in the editor? Or when printed to paper? Or displayed as strings in the command window? Or in a editable text field in a GUI?

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

채택된 답변

Daniel Shub
Daniel Shub 2012년 7월 30일
편집: Daniel Shub 2012년 7월 30일
You can do this with Yair's FEX:cprintf. Once you download and install the tool, you can do
cprintf('red', 'Do That');
  댓글 수: 3
Walter Roberson
Walter Roberson 2012년 7월 30일
cprintf('Red', 'Do That');
Daniel Shub
Daniel Shub 2012년 7월 30일
편집: Daniel Shub 2012년 7월 30일
@Walter, thank you
@Salva sorry about that, I got the syntax wrong. I edited the answer to the correct way.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by