function name as a variable
显示 更早的评论
Is it possible to do the following?
variablefun.m
function variablefun(fun)
fun
function fun1
end
function fun2
end
end
command window
variablefun(fun1)
variablefun(fun2)
2 个评论
Stephen23
2025-3-31
No, but you could write a class and define FUN1 & FUN2 as its methods.
feynman feynman
2025-3-31
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!