Compare cell arrays and delete rows

3 ビュー (過去 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 Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by