how to increase the function numbers

4 vues (au cours des 30 derniers jours)
Arun Badigannavar
Arun Badigannavar le 5 Fév 2013
I have function called "editwin",,,now i want to increase the functions dynamically like"editwin1","editwin2","editwin3","editwin4","editwin5","editwin6",,only names should change dynamically
  1 commentaire
Azzi Abdelmalek
Azzi Abdelmalek le 5 Fév 2013
If you have just one function, what is your goal in changing the name of this function?

Connectez-vous pour commenter.

Réponses (1)

Jan
Jan le 5 Fév 2013
No, please do not do this. Inserting an index in a name is always a bad idea.
Please explain what you actually want to achieve. Perhaps this helps, but usually the are better solutions:
for counter = 1:6
fcn = str2func(sprintf('editwin%d', counter))
feval(fcn) % for example
end

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by