Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Can someone please tell me where I'm wrong so that I can correct it
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
M = 2.5
fun1 = @(y) 1./y.*((sqrt(M^2 - 1)- cot(x)));
Km = integral(fun1,0,2.5);
above is my code an I need to know how to use the integral function on it. I keep getting this set of errors
Error in Intergral_test>@(y)1./y.*((sqrt(M^2-1)-cot(x)))
Error in integralCalc/iterateScalarValued (line 314)
fx = FUN(t);
Error in integralCalc/vadapt (line 132)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Error in integralCalc (line 75)
[q,errbnd] = vadapt(@AtoBInvTransform,interval);
Error in integral (line 88)
Q = integralCalc(fun,a,b,opstruct);
Error in Intergral_test (line 3)
Km = integral(fun1,0,2.5); %returns C-.
0 commentaires
Réponses (1)
John D'Errico
le 10 Juin 2017
Modifié(e) : John D'Errico
le 10 Juin 2017
You don't think having
- cot(x)));
in an integral with a kernel that is a function of y will cause a problem? :)
If x is symbolic, know that integral CANNOT solve a symbolic problem. If x is something else, I would point out that you have not defined it, in what you have shown us.
4 commentaires
John D'Errico
le 10 Juin 2017
But 0.0000001, or whatever will create a arbitrarily large result and very different, based on whether you decided to use 0.0001, 0.0000000001, whatever. So just using a small number is not the right way to solve this, since exactly what number you choose as "small" will give you absurdly different results.
The .png suggests this is something that lives along some path. What path, we don't know, since we have been given only one single expression from a book or paper.
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!