Indefinite Integral with Matlab
66 次查看(过去 30 天)
显示 更早的评论
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 ?
0 个评论
回答(2 个)
Walter Roberson
2013-3-30
syms x
yx = y(x); %where y is the function handle
int(yx,x)
2 个评论
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
2018-6-4
i have attached a file with a function. How can write this function in matlab? Thanking you
1 个评论
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 Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!