How to write Latex in GUI's label?
78 ビュー (過去 30 日間)
古いコメントを表示
I want to write latex in Matlab's GUI labels. For example:
I have tried \theta, and with $ on both sides, but it does not work. Could someone please tell me how to solve this question? Thanks.
2 件のコメント
Adam Danz
2021 年 1 月 25 日
In 2020b it doesn't exist from the design view options but the property does exist and is editable from the code.
回答 (1 件)
Adam Danz
2021 年 1 月 25 日
編集済み: Adam Danz
2021 年 1 月 25 日
From the startup function of your app, set the Edit Field Label's interpreter property to latex. You may need to reassign the string too.
function startupFcn(app)
app.thetaPoint1EditFieldLabel.Interpreter = 'latex';
app.thetaPoint1EditFieldLabel.Text = '$\theta$ of point';
end
Result:
4 件のコメント
Adam Danz
2021 年 2 月 11 日
編集済み: Adam Danz
2021 年 2 月 11 日
App designer gets more support and features with every new release since it became available. I don't know when the interpreter property was first supported for this object but I do know it works in r2020b and the result is shown in my answer. You could update to r2020b. Otherwise, there is no solution I'm aware of.
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!