using the eval command in a loop

Hi...
this line is working in my for loop...
eval(['m_text(-75,52,{' num2str(k+1992) '})'])
great...but I want to set the fontsize. How do I add this code (i,e,... 'Fontsize',12) to my eval line??
Thanks!

回答 (1 件)

Sean de Wolski
Sean de Wolski 2014 年 2 月 5 日

0 投票

Why use eval and not just call it normally?
m_text(-75,52,num2str(k+1992),'FontSize',12)
eval is evil.

1 件のコメント

crispin Donnelly
crispin Donnelly 2014 年 2 月 5 日
Right...I see..I tried that but had 'num2str' in quotes!!
Thanks for the help!

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

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

タグ

質問済み:

2014 年 2 月 5 日

コメント済み:

2014 年 2 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by