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

조회 수: 34 (최근 30일)
Mike Buba
Mike Buba 2022년 9월 30일
답변: Sulaymon Eshkabilov 2022년 10월 1일
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
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')

카테고리

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