How to create a vector of handle functions?
20 次查看(过去 30 天)
显示 更早的评论
I recently a had a problem , i wanted to create a vector of handle functions like
functions=[@(t)(t) @(t)(exp(t))]
How cn i do this ?
0 个评论
采纳的回答
Steven Lord
2019-2-1
Store your function handles in a cell array.
f = {@(t) t, @(t) exp(t), @exp} % the second and third are equivalent
valueOfSecondFunction = f{2}(0:2)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Function Handles 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!