function name as a variable
Ältere Kommentare anzeigen
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 Kommentare
Stephen23
am 31 Mär. 2025
No, but you could write a class and define FUN1 & FUN2 as its methods.
feynman feynman
am 31 Mär. 2025
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!