Double integration using experimental data

I need to perform a double integration using experimental data, but my integration limits are the same for each integral, in this case the time. After review some old posts I reached to the following code:
T = 0:0.1:600;
x = T;
A = rand(1,length(T)); % my data
pp_int = spline(T,A );
DoubleIntegration = integral(@(x)arrayfun(@(T )(integral(@(T ) ppval(pp_int,T ),0, T )),x),0,T(end) );
The code take so long to run, and give huge values. Someone I can indicate whether I am doing something wrong? If this is the case how I can correct ?
Regards

4 件のコメント

Walter Roberson
Walter Roberson 2015 年 6 月 6 日
See Bruno's suggestion http://www.mathworks.com/matlabcentral/newsreader/view_thread/337413 and also Mike's suggestion in the last there, about using waypoints.
Perhaps you should be using integral2() instead of what you are doing?
Manuel
Manuel 2015 年 6 月 17 日
編集済み: Walter Roberson 2015 年 6 月 18 日
Dear Walter,
The Bruno's suggestion only allows me to perform the first integral that is something like this:
pp_3int = spline(T,A0 );
for j=1:n-1
a=T(j);
b=T(j+1);
z2 (j) =quad(@(T) ppval(pp_3int,T), a, b,1e-10);
end
z3 = (cumsum([0 z2]));
However, I need to do a second integration using the same limits since I need to obtain the variance Variance based on the expected values for my data.
Concerning your suggestion to use the function integral2() could you explain more in detail how this can be done since the function requires a dependency of two variables?
arun
arun 2015 年 6 月 18 日
Could u mathematically explain ur problem. I can suggest u some numerical techniques to solve it.
Manuel
Manuel 2015 年 6 月 18 日
編集済み: Manuel 2015 年 6 月 18 日
Mathematically I need to calculate:

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2015 年 6 月 6 日

編集済み:

2015 年 6 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by