How to create greek letter with superscript and subscript in LEGEND OF PLOT

3 ビュー (過去 30 日間)
Matthew Greene
Matthew Greene 2022 年 8 月 24 日
コメント済み: Matthew Greene 2022 年 8 月 24 日
My goal is to create a legend entry which displays sigma_(D)^(2) ft/sec^(2)
That is, the greek letter sigma has a subscript of 'D' and a superscript of '2' and units of "ft/sec^(2)"
I coded this in my legend entry, and, upon doing so, I get an error, stating I have mismatched delimeters.
this is the code I am currently implementing that is giving me an error:
'\sigma_{D}^{2} ft/sec^{2}'
This is the error I am recieving:
"Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or
other syntax error. To construct matrices, use brackets instead of parentheses."
  2 件のコメント
Geoff Hayes
Geoff Hayes 2022 年 8 月 24 日
@Matthew Greene - you may want to show more of the code that leads to this error. When I try something like
plot(1:10,1:10)
legend('\sigma_{D}^{2} ft/sec^{2}')
I seem to get the expected results without a warning or error. Can you try the same?
Matthew Greene
Matthew Greene 2022 年 8 月 24 日
Not sure what was happening...it looks like I may have missed a comma. It's working now. I appreciate the validation!

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by