readファイルの他の配列の条件を満たしている数値を呼び出す方法を知りたいです。(例:ランニングの合計タイムを周回ごとに分割)
Show older comments
readファイルにはラップカウントと合計タイムが配列して存在するが、それらの合計タイムを周回事のラップタイムに分けたい。
Answers (1)
周回ごとの合計タイムが記録された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')
t = duration([0; table2array(TimeRecord(:,'Time'))]);
LapTime = t(2:length(t))-t(1:length(t)-1);
TimeRecord.LapTime = LapTime
Categories
Find more on MATLAB Report Generator in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!