how to find integral for this function

1 vue (au cours des 30 derniers jours)
v s ramcharan peddireddi
v s ramcharan peddireddi le 29 Juin 2016
Modifié(e) : Jan Orwat le 29 Juin 2016
this is the actual function
i coded it as fallows fun1=@(x)((sqrt(((tan(pi*x/2))/(pi*x/2))*((0.923+(0.199*(1-sin((pi*x)/2))^4)))/cos((pi*x)/2)))^2)
but i'm getting so many errors like
Error using ^ Inputs must be a scalar and a square matrix. To compute elementwise POWER, use POWER (.^) instead.
Error in Ccbeam>@(x)(mpower((sqrt(((tan(pi*x/2))/(pi*x/2))*((0.923+(0.199*(1-sin((pi*x)/2))^4)))/cos((pi*x)/2))),2)) (line 47) fun1=@(x)(mpower((sqrt(((tan(pi*x/2))/(pi*x/2))*((0.923+(0.199*(1-sin((pi*x)/2))^4)))/cos((pi*x)/2))),2))
Error in integralCalc/iterateScalarValued (line 314) fx = FUN(t);
Error in integralCalc/vadapt (line 133) [q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 76) [q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 89) Q = integralCalc(fun,a,b,opstruct);

Réponses (1)

Jan Orwat
Jan Orwat le 29 Juin 2016
Modifié(e) : Jan Orwat le 29 Juin 2016
In MATLAB there is a difference between calling * and .* The same is for ^ .^ etc.
Change
  • * to .*
  • / to ./
  • ^ to .^

Catégories

En savoir plus sur Matrix Computations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by