Cannot make a simple integral on matlab

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.
I read MathWorks
But seems like it works for 2013 version only
Don't know what to do.

1 commentaire

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

Connectez-vous pour commenter.

 Réponse acceptée

Lucas Silva
Lucas Silva le 12 Août 2013
Modifié(e) : Lucas Silva le 12 Août 2013

0 votes

Worked
Thank you
Now I got to learn what types I'll be using here. Feel free to tutor me.
And yes, yes The result is very simple. Kick the constant out of the integral. But I wanted the answer clearly represented on the paper. Step by step.
Thank you Walter and Sean

Plus de réponses (1)

Sean de Wolski
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))

Community Treasure Hunt

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

Start Hunting!

Translated by