Remove datetime values from a table

2 ビュー (過去 30 日間)
Marcus Johnson
Marcus Johnson 2023 年 10 月 4 日
コメント済み: Voss 2023 年 10 月 4 日
Hello,
I have two tables with datetime values in their respective .Var3 variable (the dates in file2/second image continues to 2023). So my question is:
How do I remove all dates from file2.Var3 that are not the dates in file1.Var3? So, I want to remove all dates from file2.Var3 that does not exist in file1.Var3, what's the easiest way to do that?
Please tell me if you need more information.
Thanks
file1
file1
file2
file2

採用された回答

Voss
Voss 2023 年 10 月 4 日
"I want to remove all dates from file2.Var3 that does not exist in file1.Var3"
I assume you mean to remove the rows from the table file2 where file2.Var3 does not exist in file1.Var3.
file2(~ismember(file2.Var3,file1.Var3),:) = [];
  2 件のコメント
Marcus Johnson
Marcus Johnson 2023 年 10 月 4 日
Yeah, that's what I meant. Thanks!
Voss
Voss 2023 年 10 月 4 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by