matlab - Change the color of specific letter in console -
i forming specific string using several strcat , displaying console. string contains characters such as: 1,2,3,4,5,6,7,8,9,0,#,*,e , using fprintf('%s') purpose.
for instance:
2e4137e65922#
is possible outcome of code.
is there anyway make letter e stand out in output? making red?
thanks @dev -il information!
while seems cprinf() other answer not work single characters, if there single color 1 wants use, , color orange, trick used warning in cprintf can used:
disp(['this [' 8 'orange]' 8 ' text']) read more at: http://undocumentedmatlab.com/blog/another-command-window-text-color-hack
thus, code like:
s='2e4137e65922#'; c=strsplit(s,'e'); str=c{1}; ii=2:size(c,2) str=[str ['[' 8 'e]' 8 ]]; str=[str c{ii}]; end disp(str); 
Comments
Post a Comment