producing colored letters in an if statement
1 次查看(过去 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
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
2012-7-30
编辑:Daniel Shub
2012-7-30
cprintf('red', 'Do That');
3 个评论
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 Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!