Calculate a value from a table column based on defined intervals give by another table
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I've got a table T with varius columns, 1'st is Time (it's not a timetable necessarly, in thsi specific case it's not, it's time in s but not as timetable).
I've got a 2'nd table T2 with 2 columns which in essence gives the time intervals (start and end lap times in this case, which will match the values in the previus table T as they are extrated from it).
What I'm trying to do is for each set of start/end time intervals in T2 calculate another column (for the given interval) in table T (max for example).
Thanks.
0 件のコメント
採用された回答
Chunru
2022 年 6 月 28 日
load("table T");
load("table T2");
head(T)
head(T2)
n = size(T2, 1);
T2_max = zeros(n, 1);
for i=1:size(T2, 1)
T2_max(i) = max(T.AmbientTemp(T.Time>=T2.Start_time(i) & T.Time<T2.End_time(i)));
end
T2.max = T2_max;
T2
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!