- Create an image that includes the equation you want to display.
- Save the image in a suitable format, such as PNG, JPEG.
- Open the 'Mask Editor' for the block in your model to create the mask icon.
- In the 'Mask Editor', go to the 'Icon' tab.
- Type the following command in the 'Icon' tab.
How to display simple fraction on a Simulink mask?
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to display a simple equation, containing a fraction (
) on the Simulink mask icon.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1527571/image.png)
In a plot I could do it with the following code:
text(0.5, 0.5, '$\alpha = \frac{\Delta T}{RC+\Delta T}$', 'interp','latex');
Unfortunatelly Simulink does not support LaTeX, only TeX interpreter, so the text and disp functions are limited.
Is there any way to do this?
0 Kommentare
Antworten (2)
arushi
am 27 Aug. 2024
Hi Bence,
I understand that you are not able to set up the desired mask icon of the expression for the block as Simulink doesnot support LaTeX editor. I encountered a similar issue, and as a workaround I used the image representation of the desired expression as the Simulink mask icon.
To represent the expression by image as a mask icon please follow these steps:
image('img.png');
6. Replace 'img.png' with the actual path of the image created in step 1 and save the Mask.
I hope it helps!
0 Kommentare
Sreeram
am 21 Okt. 2024
Hi Bence,
In MATLAB R2022b, LaTeX equations may be added to a mask using the “Icon” tab in the “Mask Editor” dialogue. By using the “Drawing Commands” > “Graphical” option in the “AUTHORING MODE” section of the toolstrip, you may use the “Equation” tool of “GENERAL” section under “Tools” on the left pane.
For your reference, I have attached the screenshots highlighting these:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1796095/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1796100/image.png)
I hope it helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Simulink Environment Customization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!