how to take a function to handle as input
6 ビュー (過去 30 日間)
古いコメントを表示
Hi;
i have a code which evaluates a function "f". but i want to take this "f" as input.
it is like;
f=@ input('please enter the predefined function name')
but this is not valid. is any way to do this ? thanks.
0 件のコメント
採用された回答
Azzi Abdelmalek
2014 年 4 月 25 日
編集済み: Azzi Abdelmalek
2014 年 4 月 25 日
Use str2func function
str=input('your function','s')
f=str2func(str)
3 件のコメント
Razan alhammad
2020 年 4 月 10 日
how i put it value in this function because also i have mistake when i put it variable in f(..)
その他の回答 (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!