Simulink: How to display small/large text in mask using disp() (change font size)

When editing the Matlab/Simulink mask code, you can display larger or smaller text text by using disp() with LaTeX commands and texmode = on.

Displaying just small text

When using texmode, you can use {\fontsize{5} ...} to format text as small. Modify 5 to whatever size you prefer.

disp("{\fontsize{5} text}", 'texmode', 'on')

Simulink mask small text

Displaying just large text

When using texmode, you can use {\fontsize{15} ...} to format text as large. Modify 15 to whatever text you prefer.

disp("{\fontsize{15} text}", 'texmode', 'on')

Simulink mask large text

Mixing small and large text with normal text

disp("{\fontsize{5} Small} and{\fontsize{15} Large} text", 'texmode', 'on')

Simulink mask mixed font sizes

Also see: