How to change font size and location in a mask icon?

39 次查看(过去 30 天)
I would like to change font size and location in a mask. I found an answer here
disp('{\bf\fontsize{12}Label Text}', 'texmode','on');
but how to apply this to my case if I have some values to display
eg.
disp(str);
str=sprintf('PI controller\n\nLimit = %g / %g', UpperLimit, LowerLimit);
UpperLimit and LowerLimit are defined as mask parameters and the mask is automatically updated when new values are applied.
disp(str, 'texmode','on')
This works, but not sure how to change font size and make it bold/italics. Or if I want to have part of the text bold (e.g PI Controller) and Limit with smaller font.

回答(1 个)

Sulaymon Eshkabilov
You can try gtext() or text(), e.g.:
gtext(['This is awesone ' date], 'fontsize', 15, 'backgroundcolor', 'y')
%% OR
text(1, 1, ['This is awesone ' date], 'fontsize', 15, 'backgroundcolor', 'y')

类别

Help CenterFile Exchange 中查找有关 String 的更多信息

标签

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by