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 ?
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

thanks, its work.
Star Strider
Star Strider 2018년 8월 26일
As always, my pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by