Index timetable variables and remove rows based on criteria.

4 vues (au cours des 30 derniers jours)
Eric Escoto
Eric Escoto le 12 Oct 2021
Commenté : Eric Escoto le 12 Oct 2021
I'm trying to remove rows of a timetable based on if any cell is greater than or equal to 8.
My line is below, can't see what the issue is with my indexing.
TT(TT{:,2:2001} >= 8, :) = [] % Remove rows with values greater than or equal to 8.0.
I only want to include columns 2:2001, but apply the indexing to all times (rows) in my data.
Thanks.

Réponse acceptée

Walter Roberson
Walter Roberson le 12 Oct 2021
TT(any(TT{:,2:2001} >= 8,2), :) = [];

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by