String scalar or character vector must have valid interpreter syntax.

I want to add:
ylabel('$\mid H(f) \mid$ (kg{s^{-1}}/kg{s^{-1}})', 'interpreter', 'latex');
Where I want the first part inside the two $$ to be in latex format and the rest in default font.
The issue seems to be while adding the superscript '^'.
For example, it works by adding:
ylabel('$\mid H(f) \mid$ (kg/s)', 'interpreter', 'latex');
Thank you in advance!

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 5 月 14 日
編集済み: Ameer Hamza 2020 年 5 月 14 日

1 投票

Mixing tex font and default fone with latex interpreter in a single text box does not work. You may try it with tex interpreter, which does not require the use of $$ symbols.
ylabel('\mid H(f) \mid (kg{s^{-1}}/kg{s^{-1}})', 'interpreter', 'tex');

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

質問済み:

2020 年 5 月 14 日

編集済み:

2020 年 5 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by