delete some matrix in cell with condition
조회 수: 2 (최근 30일)
이전 댓글 표시
Let's say I have 2 cells, & these 2 cells have relationship(cell_A and cell_B always have same dimension; mean: they have same number of matrix):
cell_A : 1x2 cell class
cell_A={[matrix_A1] [matrix_A2]};%contain 2 matrices
cell_A={[5x3 double] [2x3 double] }={[1 1 1;2 2 2;3 3 3;4 4 4;5 5 5] [11 11 11;0 0 0]};
cell_B : 1x2 cell class
cell_B={[matrix_B1] [matrix_B2]};%contain 2 matrices
cell_B={[4x1 double] [3x1 double] }={[100;6;22;33] [1;5;9]};
Now, i want to use the value in each matrices of cell_B to check corresponding matrix in cell_A.
If any value(vector) in matrix of cell_B is larger than predefined value(10). So, corresponding matrix in cell_A will be maintained.
Example: matrix_B1 have four value: 100;6;22;33. There are exist at least one value larger than 10. So, matrix_A1 will be maintained
matrix_B1 have three value: 1;5;9. There are exist NO value larger than 10. So, matrix_A2 will be deleted
result_cell={[5x3 double]}={[1 1 1;2 2 2;3 3 3;4 4 4;5 5 5]};%after delete some matrix in cell_A
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!