Previous Interpolation based on a condition
3 ビュー (過去 30 日間)
古いコメントを表示
I have a an array with 2 columns, one is datetime and the next one is values say, rate, I want to use previous interpolation on rate. My condition to do previous interpolation is, when the time is 20 seconds apart and the rate is less than 20, and if rate is greater than 20, I put NaN.
Can you help here?
5 件のコメント
Bob Thompson
2019 年 2 月 26 日
Ah, I see how it should read now. Yes, you can add that elseif condition to your if statement.
if dt == 20 & rate < 20
ir = interp1....
elseif rate > 20
ir = nan;
end
What are you going to do though if rate is exactly 20? You may just want to ignore it, just making sure you have considered the possibility.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!