title, interpreter latex and num2str

Hi,
I want to use 'interpreter','latex' in a title that contain the function num2str and I cannot make it work.
This works: title('$\alpha$','interpreter','LaTex')
But this does not: title(['$\alpha$: ',num2str(x),'$\%$'],'interpreter','latex')
Any idea how can I solve this?
Thank you

3 件のコメント

dpb
dpb 2015 年 12 月 1 日
Works fine here w/ R2012b; what're the symptoms and release?
Walter Roberson
Walter Roberson 2015 年 12 月 1 日
You could try
title( sprintf('$\\alpha$: %f$\\%%$', x) )
Notice the doubling of the \ and the % as those have special meaning is sprintf.
I had to guess about the numeric format you wanted.
Star Strider
Star Strider 2015 年 12 月 1 日
It works for me (in R2015b), at least as I expect it to work.
Attach your plot images so we can see what the problem is. (Use the floppy disk icon on the plot GUI to save the plot as .png, then in the text box here, use the brown-framed green landscape icon, and complete both the ‘Choose file’ and ‘Insert image’ steps.) I’m describing that in detail for a reason. Many people do not do all that and then wonder why their image or file did not upload.

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

回答 (1 件)

Pablo Guerrero
Pablo Guerrero 2015 年 12 月 1 日

0 投票

Yes, it does not work now.
Thank you for the help.

1 件のコメント

Walter Roberson
Walter Roberson 2015 年 12 月 1 日
It does work or it does not work? If it does work now, what did you have to change?

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

カテゴリ

ヘルプ センター および File ExchangePrinting and Saving についてさらに検索

質問済み:

2015 年 12 月 1 日

コメント済み:

2015 年 12 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by