Effacer les filtres
Effacer les filtres

using the eval command in a loop

2 vues (au cours des 30 derniers jours)
crispin Donnelly
crispin Donnelly le 5 Fév 2014
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!

Réponses (1)

Sean de Wolski
Sean de Wolski le 5 Fév 2014
Why use eval and not just call it normally?
m_text(-75,52,num2str(k+1992),'FontSize',12)
eval is evil.
  1 commentaire
crispin Donnelly
crispin Donnelly le 5 Fév 2014
Right...I see..I tried that but had 'num2str' in quotes!!
Thanks for the help!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by