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 Commenti

madhan ravi
madhan ravi il 26 Ago 2018
Modificato: madhan ravi il 26 Ago 2018
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

Accedi per commentare.

 Risposta accettata

Star Strider
Star Strider il 26 Ago 2018

0 voti

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

2 Commenti

thanks, its work.
Star Strider
Star Strider il 26 Ago 2018
As always, my pleasure.

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by