MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   Matlab中的成员检查和日期范围检查 (https://www.labfans.com/bbs/showthread.php?t=26691)

poster 2019-12-14 20:46

Matlab中的成员检查和日期范围检查
 
我有2个具有相同ID的矩阵。我需要从mat1提取ID的行,其ID的日期应在mat2中的日期的±5天之内。 mat2操作也相同。请在此处查看数据: UNIQCols = [1 2] ; dateCol = [3] ; valueCol = [4] ; dayRange = +- 15days 。

% UniqCol Date Value mat1 = [2001 2 733427 1001 ; 2001 2 733793 2002 ; 2001 2 734582 2003 ; 3001 1 734220 30 ; 3001 1 734588 20 ;]; mat2 = [2001 2 733790 7777 ; 2001 2 734221 2222 ; 3001 1 734220 10 ; 3001 1 734588 40 ;] ; ans1 = [2001 2 733793 2002 ; 3001 1 734220 30 ; 3001 1 734588 20 ] ; ans2 = [2001 2 733790 7777 ; 3001 1 734220 10 ; 3001 1 734588 40 ] ;
这需要向量化操作! ID按日期的升序排列。日期以Q或年度分隔。因此范围将始终为


所有时间均为北京时间。现在的时间是 23:14

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.