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 ?

采纳的回答

Steven Lord
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 CenterFile Exchange 中查找有关 Function Handles 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by