i dont where the wrong in this equation:
function F = Fint(a)
F = quad(@(x)(x.*sin(x))./(1-(2.*a.*cos(x))+a.^(2)),0,pi);
end
where the output i got is
Matrix dimensions must agree.
Error in Fint>@(x)(x.*sin(x))./(1-(2.*a.*cos(x))+a.^(2)) (line 2)
F = quad(@(x)(x.*sin(x))./(1-(2.*a.*cos(x))+a.^(2)),0,pi);

2 件のコメント

madhan ravi
madhan ravi 2018 年 8 月 26 日
編集済み: madhan ravi 2018 年 8 月 26 日
Is a a vector or scalar ?
Jefri Nazulrullah bin Zulkepli Amin
Jefri Nazulrullah bin Zulkepli Amin 2018 年 8 月 26 日
a vector, the question is to Return the F-values in a vector the same size as the a-vector

サインインしてコメントする。

 採用された回答

Star Strider
Star Strider 2018 年 8 月 26 日

0 投票

To integrate a vector, use the quadv (link) function.
If you have R2012a or later, use integral (link) with the 'ArrayValued' option instead.

2 件のコメント

Jefri Nazulrullah bin Zulkepli Amin
Jefri Nazulrullah bin Zulkepli Amin 2018 年 8 月 26 日
thanks, its work.
Star Strider
Star Strider 2018 年 8 月 26 日
As always, my pleasure.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by