Subscript after greek alphabet

15 ビュー (過去 30 日間)
john
john 2013 年 3 月 4 日
Hi,
could you help me please? This is me code:
vd=size(UserData.info);
for i= 0:vd(1)-4
T = regexprep(cellstr(char(sym(UserData.matrix{4+i,1}))), '([A-Za-z]+)(\d+)', '$1<FONT SIZE=-1>$2</FONT>');
T = regexprep(T, '(phi|alpha|beta|gamma|delta|epsilon|zeta|eta)', '&$1;');
result(4+i,1)=strcat('<HTML>',T);
end;
Code makes: if I write for example U1U2, than all numbers are subscript. But I need phi2U2, than everything after "phi" must be always subscript, so 2U2 must by subscript.
Thank you
  1 件のコメント
Walter Roberson
Walter Roberson 2013 年 3 月 6 日
It could be done, but with the requirement you have given, if you had something like
phi2u2+gamma8
then what you wrote would expect that {2u2+gamma8} would all be subscripted instead of just the 2u2 -- because you wrote that "everything after "phi" must always subscript" and the +gamma8 is "after "phi""

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

回答 (1 件)

Juan Camilo Medina
Juan Camilo Medina 2013 年 3 月 5 日
It depends on what kind of interpreter you have set up, but the default Matlab math and Greek letters format follow latex style, so you would need:
\phi_{2U2} % whatever is between the brackets will be subscript
to get what you want
  9 件のコメント
john
john 2013 年 3 月 11 日
Does it end when the next "phi" (specifically!) starts ...yes!!!
There will be only form U1sin(omegat+phiU1U2U3phiU4U5)....does it help?
john
john 2013 年 3 月 13 日
Please, exist there any solution?

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

カテゴリ

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