テーブルの日時が重複する行を削除したい

こんにちは。
添付のsampleの5列目にタイムスタンプ(timestamp_JST)があり、これが重複している行を削除したいのですが上手くいきません。
良い方法をご存知の方がいらっしゃいましたらご教示ください。

 채택된 답변

Atsushi Ueno
Atsushi Ueno 2021년 9월 1일

2 개 추천

load('sample1.mat');
[~,ia] = unique(sample1.timestamp_JST,'stable');
B = sample1(ia,:)
B = 5×5 table
GPS_fix GPS_date GPS_time GPS_milliseconds timestamp_JST _______ ___________________ ___________________ ________________ ___________________ 0 2021/07/03 00:00:00 2021/09/01 23:44:35 162 2021/07/04 08:44:35 2 2021/07/03 00:00:00 2021/09/01 23:44:36 162 2021/07/04 08:44:36 4 2021/07/03 00:00:00 2021/09/01 23:44:37 162 2021/07/04 08:44:37 6 2021/07/03 00:00:00 2021/09/01 23:44:38 162 2021/07/04 08:44:38 8 2021/07/03 00:00:00 2021/09/01 23:44:39 162 2021/07/04 08:44:39

댓글 수: 1

Yu
Yu 2021년 9월 1일
早速ありがとうございます!
なるほど、uniqueでtimestamp_JST列の一意の変数の行インデックスを検索するということですね。
[~,] の意味も勉強になりました。
ありがとうございました!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 table에 대해 자세히 알아보기

질문:

Yu
2021년 9월 1일

댓글:

Yu
2021년 9월 1일

Community Treasure Hunt

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

Start Hunting!