Compare cell arrays and delete rows

조회 수: 1 (최근 30일)
David du Preez
David du Preez 2016년 7월 5일
댓글: the cyclist 2016년 7월 5일
I have two cell arrays: JFM06avg(1x2) and JFM06D(88x3). I want to compare the value from the first cell in the first row from the array JFM06avg(9.3576) to the each cell in the second column of the array JFM06D. Then if the value in JFM06D is less than the value of JFM06avg then the row must be deleted.Attached are the two files.
  댓글 수: 1
the cyclist
the cyclist 2016년 7월 5일
Note that JFM06avg is not a cell array. It is numeric. This will matter for the syntax, at least in my solution.

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

채택된 답변

the cyclist
the cyclist 2016년 7월 5일
Here is one way:
rowToDelete = [JFM06D{:,2}] < JFM06avg(1);
JFM06D(rowToDelete,:) = [];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by