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 Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by