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

조회 수: 2 (최근 30일)
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
Guillaume
Guillaume 2015년 6월 22일
편집: Guillaume 2015년 6월 22일
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 2015년 6월 22일
편집: AbelM Kusemererwa 2015년 6월 22일
How? I'm a novice in matlab. it is not a cell array but a column obtained from a table with a variable name

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 22일
s={'' ;12;'';'5 '; '6';' abc';'rt';;''}
s(cellfun(@isempty,s))=[]
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 22일
편집: Azzi Abdelmalek 2015년 6월 22일
It's Azzi, not Aziz. post a sample of this column

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by