How to delete some specific rows in a cell matrix?
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
Lets say i have a cell matrix of A = {'youth' 'cool' 'poor' ;'youth' 'notcool' 'poor' ;'old' 'notcool' 'rich'}; i want to delete the rows which contains 'youth' , so that my remaining answer will be only A={'old' 'notcool' 'rich'}
Respuestas (1)
James Tursa
el 28 de Feb. de 2017
Editada: James Tursa
el 28 de Feb. de 2017
r = any(cellfun(@(x)isequal(x,'youth'),A),2); % Rows that contain 'youth'
A(r,:) = []; % Delete those rows
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!