How to create a vector of handle functions?

20 visualizaciones (últimos 30 días)
holmes idee
holmes idee el 1 de Feb. de 2019
Comentada: holmes idee el 1 de Feb. de 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 ?

Respuesta aceptada

Steven Lord
Steven Lord el 1 de Feb. de 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)

Más respuestas (0)

Categorías

Más información sobre Function Handles en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by