Changing the font size in the mask gives warning

조회 수: 3 (최근 30일)
Igor
Igor 2023년 4월 28일
답변: Fangjun Jiang 2023년 4월 30일
Hi, when I use the fontsize command in the mask
text(5,10, 'Gain','FontSize',10)
I get the warning:
I can change the font if I use|:
text(0.5,0.7,'\bf\fontsize{10}text sample')
but if I have a defined string, e.g.
select = 'version a';
str = sprintf('Selection = %s', select);
then, to display the string on the mask, I can use
dips(str)
or
text(5,10,str)
but in both cases I don't know how to change the font size.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2023년 4월 30일
You may not realize, text() used in Simulink Mask doesnot have full functionality as in MATLAB. See this note in the doc.
While this text function is identical in name to its corresponding MATLAB® function, it provides only the functionality described on this page.
To solve your problem, you need to construct a string from your variable and the TeX formatting and then use text(x,y,'text')

카테고리

Help CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by