How to create a vector of handle functions?

20 Ansichten (letzte 30 Tage)
holmes idee
holmes idee am 1 Feb. 2019
Kommentiert: holmes idee am 1 Feb. 2019
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 ?

Akzeptierte Antwort

Steven Lord
Steven Lord am 1 Feb. 2019
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)

Weitere Antworten (0)

Kategorien

Mehr zu Function Handles finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by