指定した時刻の範囲の行を、元のテーブルから抽出して、新しいテーブルを作りたい
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
一つのテーブルの中に、Var1、Var2、・・・、時刻データ(yyyy/mm/dd HH:mm:ss形式)数か月分あるのですが、
その中で、特定の時間帯(例えば06:00:00~12:00:00)のデータ行だけを、抜き取って新しいテーブルを作ることは出来るのでしょうか?
0 commentaires
Réponse acceptée
Atsushi Ueno
le 20 Mar 2023
oldT = timetable2table(readtimetable('outages.csv')); % サンプルデータ(時刻データは1列目にあるものとする)
tod = timeofday(oldT{:,1}); % 時刻データは1列目にあるものとする。これを抜き出し日付データを除く
newT = oldT(tod > '06:00:00' & tod < '12:00:00', :) % 特定の時間帯のデータ行だけを抜き取って新しいテーブルを作る
3 commentaires
Atsushi Ueno
le 20 Mar 2023
こちらは timetable 版です。
oldTT = readtimetable('outages.csv'); % サンプルデータ(時刻データは1列目にあるものとする)
tod = timeofday(oldTT.OutageTime); % 時刻データを抜き出し日付データを除く
newTT = oldTT(tod > '06:00:00' & tod < '12:00:00', :); % 特定の時間帯のデータ行だけを抜き取って新しいテーブルを作る
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Dictionaries dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!