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

3 visualizzazioni (ultimi 30 giorni)
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 Commenti
Geoff Hayes
Geoff Hayes il 24 Ago 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 il 24 Ago 2022
Not sure what was happening...it looks like I may have missed a comma. It's working now. I appreciate the validation!

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Labels and Annotations in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by