Programmatically add annotation with an equation to simulink
4 ビュー (過去 30 日間)
表示 古いコメント
Hey all,
I'm trying to add an annotation to a Simulink model which includes an equation using Latex syntax. However, all I get is the plain text.
latexString = 'x = \frac{1}{2}'
h = Simulink.Annotation(gcs, latexString);
How exactly do I do this?
Thanks!
0 件のコメント
回答 (1 件)
Bhavana Ravirala
2023 年 2 月 13 日
編集済み: Bhavana Ravirala
2023 年 2 月 13 日
Hi Cedric,
To add a Latex equation to a Simulink annotation, you need to use the Latex interpreter by setting the 'Interpreter' property of the annotation object to 'latex'. Refer the code below:
latexString = 'x = \frac{1}{2}';
h = Simulink.Annotation(gcs, latexString);
set(h, ' Description', 'latex');
You can also use the function ‘pslinkfun’ to programmatically add annotations to a block in a model.
Please refer to the documentation below for more information.
Hope this helps!!
参考
カテゴリ
Find more on Model, Block, and Port Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!