find time at the midpoint of data
1 回表示 (過去 30 日間)
古いコメントを表示
I have data for which I need to find the time at which the midpoint has been reached. I have a vector of flow rates and a vector of times corresponding to those flow measurements. I was about to code it by hand, when I found the trapz() function to do the numeric integration and give the total discharge. I also need the time at which 50% of the discharge occurred. Is there a function which would give this? I'm aware of how to code it manually, I just want to know if a function already exists to do this.
0 件のコメント
採用された回答
Star Strider
2015 年 5 月 5 日
The cumtrapz function will give you a progressive integration of your data, in this instance of flow rates as a function of time.
For example:
Int_Flow = cumtrapz(time, flow_rate);
2 件のコメント
Star Strider
2015 年 5 月 5 日
Use the interp1 function to find the time.
Int_Flow = cumtrapz(time, flow_rate);
Flow50 = interp1(Int_Flow, time, Int_Flow(end)/2);
This will give you the time at which the 50% discharge occurs (if I understand your question correctly). The 50% discharge is of course Int_Flow(end)/2.
その他の回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!