Problem with integrals
显示 更早的评论
I have a integral that simplified looks like this:
quad(@(z) exp(z.^2),-2,x)
The problem here is quite obvious. You can't use quad quad a variable as a limit. So why don't I use int? Because exp(z^2) is an analytically unsolvable integral. In the task I'm trying to solve there is a second integral of the first integral and simplified it looks like this:
quad(@(x) exp(x.^2).*quad(@(z) exp(z.^2),-2,x),-2,2)
And according to my mentor there should be a way to solve this because he says that the first integration will make the other one solvable. The code above gives this error:
??? Error using ==> quad at 70
The limits of integration must be scalars.
Error in ==> @(x)exp(x.^2).*quad(@(z)exp(z.^2),-2,x)
Error in ==> quad at 77
y = f(x, varargin{:});
Error in ==> test at 54
quad(@(x) exp(x.^2).*quad(@(z) exp(z.^2),-2,x),-2,2)
So I thought I should ask you if there is a way to do what I'm trying to do (with any command, it does not have to be quad) or if its not possible.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Numeric Solvers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!