Cannot make a simple integral on matlab
Afficher commentaires plus anciens
First I've tried this:
Fm=1/(2*pi)*(int(220*2^0.5,0,pi)+int(220*2^0.5,pi,2*pi))
Returns this: Undefined function or method 'int' for input arguments of type 'double'.
Then, I've tried this:
Fm=1/(2*pi)*(quadgk(220*2^0.5,0,pi)+quadgk(220*2^0.5,pi,2*pi))
Which returns this: First input argument must be a function handle.
And This:
Fm=1/(2*pi)*(integral(220*2^0.5,0,pi)+integral(220*2^0.5,pi,2*pi))
Resulting on this: Undefined function or method 'integral' for input arguments of type 'double'
What about this:
1/(2*pi)*(integral(220*2^0.5,0,pi)+integral(220*2^0.5,pi,2*pi))
Hmm... NO!
Maybe this:
integral(220*2^0.5,0,pi), or this: int(220*2^0.5,0,pi)
No! Says Matlab r2010a... I don't like you, little user.
But seems like it works for 2013 version only
Don't know what to do.
1 commentaire
Walter Roberson
le 12 Août 2013
Are you really integrating a constant value (220*sqrt(2)) over the range pi to 2*pi ? You know that the integral of a constant over a definite integral is just the constant times the width of the interval ?
Réponse acceptée
Plus de réponses (1)
Sean de Wolski
le 12 Août 2013
You need to convert the doubles to syms:
Fm=1/(2*pi)*(int(sym('220*2^0.5'),0,pi)+int(sym('220*2^0.5'),pi,2*pi))
Catégories
En savoir plus sur Common Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!