필터 지우기
필터 지우기

How to display simple fraction on a Simulink mask?

조회 수: 9 (최근 30일)
Bence
Bence 2023년 11월 2일
편집: Gagan Agarwal 2023년 11월 17일
I want to display a simple equation, containing a fraction () on the Simulink mask icon.
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?

답변 (1개)

Gagan Agarwal
Gagan Agarwal 2023년 11월 17일
편집: Gagan Agarwal 2023년 11월 17일
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:
  1. Create an image that includes the equation you want to display.
  2. Save the image in a suitable format, such as PNG, JPEG.
  3. Open the 'Mask Editor' for the block in your model to create the mask icon.
  4. In the 'Mask Editor', go to the 'Icon' tab.
  5. Type the following command in the 'Icon' tab
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!

카테고리

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

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by