Compare cell arrays and delete rows
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
David du Preez
le 5 Juil 2016
Commenté : the cyclist
le 5 Juil 2016
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 commentaire
the cyclist
le 5 Juil 2016
Note that JFM06avg is not a cell array. It is numeric. This will matter for the syntax, at least in my solution.
Réponse acceptée
the cyclist
le 5 Juil 2016
Here is one way:
rowToDelete = [JFM06D{:,2}] < JFM06avg(1);
JFM06D(rowToDelete,:) = [];
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Types dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!