how to delete rows of the character '' from a column or column vector
1 次查看(过去 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
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.
采纳的回答
Azzi Abdelmalek
2015-6-22
s={'' ;12;'';'5 '; '6';' abc';'rt';;''}
s(cellfun(@isempty,s))=[]
3 个评论
Azzi Abdelmalek
2015-6-22
编辑:Azzi Abdelmalek
2015-6-22
It's Azzi, not Aziz. post a sample of this column
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!