How to change font size and location in a mask icon?
29 次查看(过去 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.
0 个评论
回答(1 个)
Sulaymon Eshkabilov
2022-10-1
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')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Author Block Masks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!