|
This will either be really simple, or practically impossible. So lets say I have the following code...
str1=strcat('SD=', randomVar1);
str2=strcat('zscore=', randomVar2);
str3=strcat('R^2=', randomVar3);
set(textBox, 'String', [str1, char(10), str2, char(10), str3], 'BackgroundColor', [1 1 1], 'Position', [.84 .105 .135 sizestat], 'FontSize', 8, 'HorizontalAlignment', 'left');
This will create some textbox on my figure that will look sort of like this (presuming my text doesn't get mangled):
--------------------------------
| SD=X.XXX |
| zscore=-X.XXX |
| R^2=X.XXX |
--------------------------------
and of course, presume that I have some numerical values for randomVar1, 2 and 3... they've been represented as X.XXX or -X.XXX.
Since it's really hard to see the negative sign in the figure I would like to add colors to certain portions of the text in the textbox, but not all of it. Ideally, I want to color green for positive and red for negative values.
So im wondering if its possible to color a certain portion of the text such as just the "SD=X.XXX" section?
Thanks for any help in advance!!
-Keith
|