Plus and minus sign for an equation
781 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rooy
am 18 Mär. 2012
Kommentiert: Walter Roberson
am 27 Apr. 2018
I need the plus and minus sign before the square root function, am I doing it right?
a=((xx+yy)/2)+sqrt((((xx+yy)^2)/2)+xy^2);
a=[a,-a];
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Naresh Virothi
am 27 Apr. 2018
how to type plus or minus symbol in matlab
2 Kommentare
John D'Errico
am 27 Apr. 2018
Please don't add an answer just to ask a question.
And there is no plus OR minus symbol in MATLAB, that is, a symbol that indicates EITHER plus or minus.
Unless of course you just mean a string.
'+/-'
ans =
'+/-'
Walter Roberson
am 27 Apr. 2018
>> char(177)
ans =
'±'
However, this has no significance to equations and will be rejected as an error in source code except in comments or character vectors or string objects.
If you need this for labels, then, for example,
text(0.5,0.5,'$\pm$','interpreter','latex')
If you need the minus on top and the plus underneath then \mp
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!