Borrar filtros
Borrar filtros

how to delete empty entry from a table

4 visualizaciones (últimos 30 días)
Ayushi Saxena
Ayushi Saxena el 13 de Abr. de 2016
Respondida: Azzi Abdelmalek el 13 de Abr. de 2016
I have a table consisting of numbers & strings. I need to delete the rows which has empty string value in a particular column. I tried using c.Rollnumber=='' for selecting empty string but getting error.
Thanks

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 13 de Abr. de 2016
%------Example----------------
v={'a' 1 'k';'b' 2 '';'' 1 'v'}
w=cell2table(v)
%------the code---------------
a=table2cell(w)
idx=any(ismember(cellfun(@num2str,a,'un',0),''),2)
w(idx,:)=[]

Más respuestas (0)

Categorías

Más información sobre Tables 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!

Translated by