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

3 Ansichten (letzte 30 Tage)
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 Kommentare
Geoff Hayes
Geoff Hayes am 24 Aug. 2022
@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 am 24 Aug. 2022
Not sure what was happening...it looks like I may have missed a comma. It's working now. I appreciate the validation!

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Labels and Annotations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by