readファイルの他​の配列の条件を満たし​ている数値を呼び出す​方法を知りたいです。​(例:ランニングの合​計タイムを周回ごとに​分割)

1 回表示 (過去 30 日間)
権
2023 年 1 月 19 日
編集済み: covao 2023 年 4 月 2 日
readファイルにはラップカウントと合計タイムが配列して存在するが、それらの合計タイムを周回事のラップタイムに分けたい。

回答 (1 件)

covao
covao 2023 年 4 月 2 日
編集済み: covao 2023 年 4 月 2 日
周回ごとの合計タイムが記録されたcsvファイルから、周回ごとのラップタイムを算出する例です。
% Write time record file
tmp = {
1,'00:1:02.050';...
2,'00:1:58.060';...
3,'00:2:59.080'
};
TimeRecord = cell2table(tmp,'VariableNames',{'No','Time'});
writetable(TimeRecord,'laptime.csv');
% Read time record file
TimeRecord = readtable('laptime.csv')
TimeRecord = 3×2 table
No Time __ ____________ 1 00:01:02.050 2 00:01:58.060 3 00:02:59.080
t = duration([0; table2array(TimeRecord(:,'Time'))]);
LapTime = t(2:length(t))-t(1:length(t)-1);
TimeRecord.LapTime = LapTime
TimeRecord = 3×3 table
No Time LapTime __ ____________ ____________ 1 00:01:02.050 00:01:02.050 2 00:01:58.060 00:00:56.010 3 00:02:59.080 00:01:01.020

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!