how to delete rows of the character '' from a column or column vector

how to delete rows of the character '' from a column or column vector
e.g column_vector={'2';'3';'';'54';'';'';'';'4';'19'} to become column_vector={'2';'3';'54';'4';'19'}

4 comentarios

Do you mean from a cell array? please post a sample of your data
e.g column_vector={'2';'3';'';'54';'';'';'';'4';'19'} to become column_vector={'2';'3';'54';'4';'19'}
Guillaume
Guillaume el 22 de Jun. de 2015
Editada: Guillaume el 22 de Jun. de 2015
if the column_vector is a cell array as in the example provided, then the '' character is not a character at all, but an empty string which is detected by isempty. See Azzi's answer.
if the column_vector is a truly a column vector, it is a char array. Then the '' character may very well be a character which can be removed according to James' answer.
Using proper terminology helps in getting the right answer.
AbelM Kusemererwa
AbelM Kusemererwa el 22 de Jun. de 2015
Editada: AbelM Kusemererwa el 22 de Jun. de 2015
How? I'm a novice in matlab. it is not a cell array but a column obtained from a table with a variable name

Iniciar sesión para comentar.

 Respuesta aceptada

s={'' ;12;'';'5 '; '6';' abc';'rt';;''}
s(cellfun(@isempty,s))=[]

3 comentarios

Thanks Aziz. It does not work with column obtained from a table.
Azzi Abdelmalek
Azzi Abdelmalek el 22 de Jun. de 2015
Editada: Azzi Abdelmalek el 22 de Jun. de 2015
It's Azzi, not Aziz. post a sample of this column

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Productos

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by