how to increase the function numbers
조회 수: 4 (최근 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
2013년 2월 5일
If you have just one function, what is your goal in changing the name of this function?
답변 (1개)
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!