Given a table, how can I delete rows not satisfying a certain property?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Emiliano Ascenzi
le 24 Jan 2020
Réponse apportée : Bhaskar R
le 24 Jan 2020
Given a table, i want to build a new table keeping only rows where values of column 1 are 35<x<40 and values of column 2 are 20<y<22, other values doesn't interest me. Alternatively i want column vectors without not desiderate values
Réponse acceptée
Bhaskar R
le 24 Jan 2020
Assuming t is your table variable and variable names are col_1 and col_2,
cond = (35>t.col_1 & t.col_1<40)&(20>t.col_2 & t.col_2<20); % your condition
new_t = t(cond, :) ; % your new table based on condition
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Structures 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!