MATLAB: How to change the text color within a multi-line cell array

text;

I'm adding multi-line text to a plot using a cell array and the text command. I can change font attributes like bold and italics but I need to change the color of one line.
label(4) in the code below needs to be bold (no problem there) but I'd like it to be red as well. Putting attributes in the cell like this … ['\bfTarget Length Met','color','r'] gives me an error.
label(1)={['S = ',num2str(compliance,formatSpec),' mm/kN']};
label(2)={['R^2 = ',num2str(rsq)]};
label(3)={['a = ',num2str(acur)]};
label(4)={['\bfTarget Length Met']};
text_xplace=min(cmod)+(max(cmod)-min(cmod))/10;
text_yplace=f_max-(f_max-min(force))/4;
text(text_xplace, text_yplace,(label))
Any one got a solution?

Best Answer

If you look at the documentation for text() you can see an example, i pasted it below.
text(.1,.5,['\fontsize{16}black '...
'{\color{magenta}magenta '...
'\color[rgb]{0 .5 .5}teal '...
'\color{red}red} black again'])
oh its late so i didn't read it carefully. you'll have to do the that during the plotting phase.