フィルターのクリア

Add Bar over Letter x for mean value symbol

138 ビュー (過去 30 日間)
Dennis
Dennis 2022 年 10 月 25 日
コメント済み: Star Strider 2022 年 10 月 25 日
Hey guys I got the folloving code and would love to set a bar above the letter x to get the mean-symbol. But it's not functioning.
strVDrift = {['$\overline{x}$_1: ' num2str(bar1_vd),'$\overline{x}$_{2}: ' num2str(bar2_vd),'$\overline{x}$_{3}: ' num2str(bar3_vd)],['$\overline{x}$_{4}: ' num2str(bar4_vd),'$\overline{x}$_{5}: ' num2str(bar5_vd),...
'$\overline{x}$_{6}: ' num2str(bar6_vd)],['$\overline{x}$_{7}: ' num2str(bar7_vd),'$\overline{x}$_{8}: ' num2str(bar8_vd),'$\overline{x}$_{9}: ' num2str(bar9_vd),'$\overline{x}$_{10}: ' num2str(bar10_vd)]};
a7 = annotation('textbox',dim7,'String',strVDrift,'FitBoxToText','on',Interpreter='latex');

回答 (1 件)

Star Strider
Star Strider 2022 年 10 月 25 日
Use '$\bar{x}$' to get:
.
  2 件のコメント
Dennis
Dennis 2022 年 10 月 25 日
編集済み: Dennis 2022 年 10 月 25 日
it did not work with my code...
and how can i then attach the subscript numbers?
Star Strider
Star Strider 2022 年 10 月 25 日
It would help to have some of the numbers.
bar1_vd = rand;
bar2_vd = rand;
bar3_vd = rand;
bar4_vd = rand;
bar5_vd = rand;
bar6_vd = rand;
bar7_vd = rand;
bar8_vd = rand;
bar9_vd = rand;
bar10_vd = rand;
strVDrift = {['$\bar{x}_1: ' num2str(bar1_vd) '\bar{x}_{2}: ' num2str(bar2_vd),'\bar{x}_{3}: ' num2str(bar3_vd),'\bar{x}_{4}: ' num2str(bar4_vd),'\bar{x}_{5}: ' num2str(bar5_vd),...
'\bar{x}_{6}: ' num2str(bar6_vd),'\bar{x}_{7}: ' num2str(bar7_vd),'\bar{x}_{8}: ' num2str(bar8_vd),'\bar{x}_{9}: ' num2str(bar9_vd),'\bar{x}_{10}: ' num2str(bar10_vd) '$']};
text(0.1, 0.8, strVDrift, 'Interpreter','latex')
strVDrift = {['$\bar{x}_1: ' num2str(bar1_vd) '$' newline '$' '\bar{x}_{2}: ' num2str(bar2_vd) '$' newline '$' '\bar{x}_{3}: ' num2str(bar3_vd) '$' newline '$' '\bar{x}_{4}: ' num2str(bar4_vd) '$' newline '$' '\bar{x}_{5}: ' num2str(bar5_vd),...
'$' newline '$' '\bar{x}_{6}: ' num2str(bar6_vd) '$' newline '$' '\bar{x}_{7}: ' num2str(bar7_vd) '$' newline '$' '\bar{x}_{8}: ' num2str(bar8_vd) '$' newline '$' '\bar{x}_{9}: ' num2str(bar9_vd) '$' newline '$' '\bar{x}_{10}: ' num2str(bar10_vd) '$']};
text(0.1, 0.4, strVDrift, 'Interpreter','latex')
% a7 = annotation('textbox',dim7,'String',strVDrift,'FitBoxToText','on',Interpreter='latex');
I have no idea what you want to do, so I created two versions of the string.
I used text to test it, and used ‘\bar’ just to make sure it works.
.

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

カテゴリ

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