String scalar or character vector must have valid interpreter syntax

axis ([0,20,0,20])
text(3.0, 8.0,'\fontsize{30} \omega=2 \pi*f=2 \pi*c/ \lamda')

2 件のコメント

Nicolás Bozzo
Nicolás Bozzo 2023 年 1 月 23 日
the letter is called lambda not lamda
Walter Roberson
Walter Roberson 2023 年 1 月 23 日
In Modern Greek, the name of the letter is Λάμδα
Unicode uses the (Modern Greek-based) spelling "lamda" in character names, instead of "lambda", due to "the pre-existing names in ISO 8859-7, as well as preferences expressed by the Greek National Body".[18]

サインインしてコメントする。

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 9 月 28 日
編集済み: Ameer Hamza 2020 年 9 月 28 日

1 投票

Here are two options to write this
axis ([0,20,0,20])
text(3.0, 8.0,'$\omega=2 \pi*f=2 \pi*c /\lambda$', ...
'Interpreter', 'latex', ...
'FontSize', 30)
and
axis ([0,20,0,20])
text(3.0, 8.0,'\omega=2 \pi*f=2 \pi*c /\lambda', ...
'Interpreter', 'tex', ...
'FontSize', 30)

5 件のコメント

George Rodriguez
George Rodriguez 2020 年 9 月 28 日
Thank you so much!
Ameer Hamza
Ameer Hamza 2020 年 9 月 28 日
I am glad to be of help!!!
George Rodriguez
George Rodriguez 2020 年 9 月 28 日
I try to emulate what you did for another code but my subscripts and superscripts do not appear. Can you tell me what am i doing wrong?
text(2,2, '\ y_{z} = e^{2} = 1+ x+ x^{2}/2!+ \x^{3}/3+',...
'Interpreter', 'tex', ...
'FontSize', 20)
thank you again.
Ameer Hamza
Ameer Hamza 2020 年 9 月 28 日
You placed escape character (\) at unnecessary locations
text(2,2, 'y_{z} = e^{2} = 1+ x+ x^{2}/2!+ x^{3}/3+',...
'Interpreter', 'tex', ...
'FontSize', 20)
George Rodriguez
George Rodriguez 2020 年 9 月 28 日
Oh, you use it only for special charaters I see, thank you again!

サインインしてコメントする。

カテゴリ

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

タグ

質問済み:

2020 年 9 月 28 日

コメント済み:

2023 年 1 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by