How to input a function into a function?
5 ビュー (過去 30 日間)
古いコメントを表示
I wrote a matlab function fun1 and fun2
and when I included them as inputs in third function fun3 that I wrote, it gives an error - not enough input arguments.
0 件のコメント
回答 (1 件)
michio
2020 年 2 月 15 日
編集済み: michio
2020 年 2 月 15 日
Have you tried using funtion handles? You can use them as inputs instead of directly using function names.
3 件のコメント
michio
2020 年 2 月 15 日
Hm, I apologize that I haven’t given you a suitable example that suita your case, but those functions (fun1-fun3 above) can be defined as separate m-files or as subfunctions, or as nested functions. There should be a way to make it work :)
Could you give me more detailed info? Such as sample code or.. anything that explains your situation.
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!