How to create a vector of handle functions?
21 ビュー (過去 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!