problem with inputting function handle without using a separate function file

2 ビュー (過去 30 日間)
Robert
Robert 2014 年 4 月 15 日
回答済み: Robert 2014 年 4 月 15 日
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

採用された回答

Robert
Robert 2014 年 4 月 15 日
that form works, thank you so much!!!

その他の回答 (1 件)

Walter Roberson
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.

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by