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.
mask_font_size_examples.m
disp("{\fontsize{5} text}", 'texmode', 'on')
Displaying just large text
When using texmode, you can use {\fontsize{15} ...} to format text as large. Modify 15 to whatever text you prefer.
mask_font_size_large_inline.m
disp("{\fontsize{15} text}", 'texmode', 'on')mask_font_size_large.m
disp("{\fontsize{15} text}", 'texmode', 'on')
Mixing small and large text with normal text
mask_font_size_mix_inline.m
disp("{\fontsize{5} Small} and{\fontsize{15} Large} text", 'texmode', 'on')mask_font_size_mix.m
disp("{\fontsize{5} Small} and{\fontsize{15} Large} text", 'texmode', 'on')
Also see:
- Simulink: How to display bold text in mask using disp()
 - Simulink: How to display italic text in mask using disp()
 
Check out similar posts by category:
Matlab/Simulink
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow