How to create a vector of handle functions?

20 vues (au cours des 30 derniers jours)
holmes idee
holmes idee le 1 Fév 2019
Commenté : holmes idee le 1 Fév 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 ?

Réponse acceptée

Steven Lord
Steven Lord le 1 Fév 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)
  1 commentaire
holmes idee
holmes idee le 1 Fév 2019
Thank you , it really helping me

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Function Handles dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by