filtering a cell array with date serial number
조회 수: 1 (최근 30일)
이전 댓글 표시
I have two cell arrays. Cell array one is a column that has a serial date number in every row and only one column. cell array two consists of many individual matrix tables which have a serial date number in column one whilst the other columns have other values. i want to filter cell array two in such a way that it only displays the rows in every individual matrix that contains the serial date number in cell array one.
댓글 수: 0
답변 (1개)
Walter Roberson
2015년 9월 27일
Under the assumption that you want to filter down to the entries that match any of the dates in the first matrix (instead of wanting to produce one set of matrices for the matches for the first entry, another set for the matches for the second set, and so on):
targetvals = cell2mat(CellArray1);
Subsets = cellfun(@(C) C(ismember(cell2mat(C),targetvals),:), CellArray2, 'Uniform', 0);
댓글 수: 3
Walter Roberson
2015년 10월 1일
matches = ismember(MATRIX2(:,1), MATRIX1);
NewMATRIX2 = MATRIX2(matches,:);
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!