how to increase the function numbers

1 次查看(过去 30 天)
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 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2013-2-5
If you have just one function, what is your goal in changing the name of this function?

请先登录,再进行评论。

回答(1 个)

Jan
Jan 2013-2-5
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

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by