필터 지우기
필터 지우기

Indefinite Integral with Matlab

조회 수: 31 (최근 30일)
Jeena
Jeena 2013년 3월 30일
댓글: Walter Roberson 2018년 6월 4일
Hi all,
I have a question about using indefinite integral in Matlab with out using symbolic toolbox. I have to find the integral for the following function
y@(x) = x + 2*sin(x) ;
I know how to do this with a symbolic variable using the 'int' function. But is there a way to do the indefinite integral when I defined the function by an anonymous function handle ? I was able to find the definite integral of the function using either 'integral' or by using 'quad'. But these functions cannot be used when I just need to integrate it indefinitely with out a bounded limit.
Can some help me to find a solution ?

답변 (2개)

Walter Roberson
Walter Roberson 2013년 3월 30일
syms x
yx = y(x); %where y is the function handle
int(yx,x)
  댓글 수: 2
Jeena
Jeena 2013년 4월 1일
Thanks for the answer, but still it uses a symbolic toolbox for the computation, right ???
I need to perform this computation without symbolic toolbox (or without any additional Matlab toolbox functions)...
Any suggestions ??
Walter Roberson
Walter Roberson 2013년 4월 1일
Then you would have to convert the function to a string and analyze the string in order to do the integration, with it being quite possible that there is no known analytic solution for the indefinite integral. Your library of integration tools would have to be quite large, and yet you would be be easily thwarted by someone providing (for example)
@(x) cos(sin(x))
It is not possible to do indefinite integration numerically -- only by analysis of the known properties of the named functions.

댓글을 달려면 로그인하십시오.


Pawan Kumar
Pawan Kumar 2018년 6월 4일
i have attached a file with a function. How can write this function in matlab? Thanking you
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 6월 4일
The solution depends on whether k is positive, 0, or negative, and on the relative values of qs and 2*k . In some combinations of circumstances it is undefined. MATLAB is able to resolve some of the combinations if you add appropriate assumptions to the variables, but it is not able to tell you the full conditional resolution under other assumptions.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by