フィルターのクリア

the superscript in the textbox in the figure?

14 ビュー (過去 30 日間)
Mary Jon
Mary Jon 2014 年 3 月 24 日
コメント済み: Fei Wang 2017 年 6 月 25 日
How can I put (degree) the degree of temperature Celsius in the text box inside the figure? ex: C to the power (Celsius)
  1 件のコメント
Fei Wang
Fei Wang 2017 年 6 月 25 日
1. Right click, then Select latex mode 2. input $^{\circ}$C 3. done

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

採用された回答

Image Analyst
Image Analyst 2014 年 3 月 24 日
You can do this:
plot(1:10);
str = sprintf('30 %cC', 176); % ASCII 176 looks like the degree symbol.
text(2,2,str);
  3 件のコメント
Image Analyst
Image Analyst 2014 年 3 月 24 日
Yes, but I don't know LaTex. I don't need to since modern work processors have all the formatting I need and I'm not required to know LaTex, though I know there are still some people who still use it.
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014 年 3 月 26 日
LOL! I still do, though I don't recommend it. But I prefer it to Microsoft Word when it comes to write hundreds of pages, and I'm gonna stick to it, unless you kindly suggest me a better one.
Tnx

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

その他の回答 (5 件)

Star Strider
Star Strider 2014 年 3 月 24 日
編集済み: Star Strider 2014 年 3 月 24 日
It’s very well hidden in the documentation. In the online documentation it’s under String. That reveals:
\circ º
The rest of the special TeX characters are there as well.

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014 年 3 月 24 日
編集済み: Salaheddin Hosseinzadeh 2014 年 3 月 24 日
As I remember MATLAB understand a little bit of Latex! lol
If you've ever worked with Latex which is just like writing in a linear form try this
legend('C^{Celcious}') or title or xlable or ...
or
title('C^o')
if you want to have Celsius sign
Let me know about the results plz.
Good Luck!
  2 件のコメント
Mary Jon
Mary Jon 2014 年 3 月 24 日
Thank u Hosseinzadeh
I want write C^o in the text box (superscript)in the figure (near the curve )only not as legend or title,
your answer is as legend or title,
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014 年 3 月 26 日
You can apply the same format to text, legend, disp, display, labelx labely title and similar functions that accept strings generally

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


Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014 年 3 月 24 日
If you have a variable then you can concatenate the string simply
x=30;
title([num2str(x),'^c']) or legend or text or xlable or ...
Be lazy and go with the easy one! lol
Good Luck!
  1 件のコメント
Mary Jon
Mary Jon 2014 年 3 月 24 日
Mr. Hosseinzadeh
your code put title in the top of figure (30^c)
the answer of (Image Analyst )is excellent.

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


Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014 年 3 月 26 日
I don't know what version of MATLAB you are using! But the following code resulted as such on my PC with 2012a and it's really easy to use this notation! You can see the image as well!
figure
text(0.1,0.1,'Hello^{World}')
text(.3,.3,'trying_{subscript}')
text(.6,.6,'trying_{subscript}^{power}')
  3 件のコメント
Mary Jon
Mary Jon 2014 年 3 月 26 日
Thank u Salaheddin Hosseinzadeh
Wow,matlab is very good tool,really.
I want to learn not every thing, but more thing on it
Image Analyst
Image Analyst 2014 年 3 月 26 日
You CAN click on the image to bring it up full size. At least using Firefox you can.

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


Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014 年 3 月 26 日
Another instance when you have numbers to deal with!
>> x=30
x =
30
>> figure
>> text(.1,.1,[num2str(x),'^c'])
>>

カテゴリ

Help Center および File ExchangeTitle についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by