Delete rows in cell that contain part of string
30 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
newbie9
el 13 de Mzo. de 2019
Comentada: newbie9
el 13 de Mzo. de 2019
I have an Nx2 cell (mixes of strings and doubles) that I'm trying to clean up (rawdata). Specifically, I am trying to delete all rows with ">" in the first column. My code below is deleting those rows, but it is reshaping the cell as an Mx1 cell (data1). I'm not sure where the error is. Thanks for any help.
rawdata = textscan(fid, '%s %s' , 'HeaderLines', 7);
rawdata = [rawdata{:}];
data1 = rawdata(cellfun(@(s)isempty(regexp(s,'>')),rawdata));
0 comentarios
Respuesta aceptada
madhan ravi
el 13 de Mzo. de 2019
Editada: madhan ravi
el 13 de Mzo. de 2019
Cell(strcmp(Cell(:,1),'>'),:)=[]
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!