Triple integral (NO with @func)

1 次查看(过去 30 天)
Diego Soler Polo
Diego Soler Polo 2019-10-10
回答: Steven Lord 2019-10-10
I have a numerical function, F, depending on three variables, x,y,z, and I need to integrate it. The problem is that F does not have an explicit expression in terms of elementary functions, but rather, given (x,y,z), F(x,y,z) is calculated in a subroutine. How do I integrate numerically such a function?
Function handles don't work in this case, since I don't have a closed analytical expression for F.

回答(1 个)

Steven Lord
Steven Lord 2019-10-10
integral3 doesn't care whether or not you can write your integrand in a particular way. All it cares about is that it can call the function whose handle you pass in as the first input argument with three inputs that are the same size and returns an output of that same size containing values of your integrand for the corresponding elements of the inputs. It sounds like you already have such a function: "but rather, given (x,y,z), F(x,y,z) is calculated in a subroutine."
You could theoretically have your integrand function display "Perform an experiment with these parameters: ..." and ask the user to input the integrand value measured in those experiments. Most of the time the integral* functions will ask you to evaluate the function for too many parameter values for that to be feasible, but it is possible.

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by