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.
But seems like it works for 2013 version only
Don't know what to do.
댓글 수: 1
Walter Roberson
2013년 8월 12일
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 ?
채택된 답변
추가 답변 (1개)
Sean de Wolski
2013년 8월 12일
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))
카테고리
도움말 센터 및 File Exchange에서 Common Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!