problem with inputting function handle without using a separate function file
1 次查看(过去 30 天)
显示 更早的评论
Hi Ive wrote a function called T with inputs f,a,b,n. im not having problems with the a,b,n input values but when i try to input the function handle f the T function prints an error the only way i can stop this is to put the function handle f in a separate function file and us commands like this T(@f,a,b,n) but id like to write T(x,a,b,n) for the function x, how can i do this? thanks
0 个评论
采纳的回答
更多回答(1 个)
Walter Roberson
2014-4-15
f = @(x) sin(x);
T(f, a, b, n)
If this form does not work then please show your error messages.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!