添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
讲道义的茴香  ·  <no title> — darts ...·  5 月前    · 
有腹肌的火腿肠  ·  Boomi User Community·  8 月前    · 
风流倜傥的烈酒  ·  Atheros Qualcomm ...·  10 月前    · 
i saved my output in txt file.....
myOutput = Image Processing is interesting
i wanted to display the word "Process" in green color and the remaining words in black color itself....
i found a link in which we can format the text in different ways....
but in all those examples we give the full text to change color... but i want only a portion of the text to change its color...
if found the starting position of Process and the position upto which i want to change color... but i dont know how to keep the other text colors black and "Process" only green...... please can someone help me solve it.... i need the output to be displayed either in command window or txt file.... but the only thing is the change in color shud be there.....please do reply....
Use a combination of FPRINTF and CPRINTF, without outputting CR/LF before the "final" end of line.
>> fprintf( 'This is a ' ) ; cprintf( '_red' , 'colorful ' ) ; fprintf( 'example!\n' ) ;
but be aware that CPRINTF is rather slow.
>> tic ; for k = 1:1e2, fprintf( '.' ) ; end ; fprintf( '\n' ) ; toc
... .................... ..
Elapsed time is 0.001758 seconds.
>> tic ; for k = 1:1e2, cprintf( '_red' , '.' ) ; end ; fprintf( '\n' ) ; toc
... .................... ..
Elapsed time is 1.458687 seconds.

Community Treasure Hunt

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

Start Hunting!