delete rows from cell array
Show older comments
i have a cell array with string as below (format is "number""space""-""space""number")
1234 - 5678
543 - 2345
5678 - 1234
delete the numbers relations such as
1234 - 5678
5678 - 1234
and keep first one of them and get output as
1234 - 5678
543 - 2345
i need to search using '-'
i get empty matrix, when i do as below
index = find(ismember(cellArr(1), ' - '))
2 Comments
Rik
on 23 Feb 2017
So your question is how to remove the rows with pairs that are descending?
index is empty, because you are comparing a single cell with the text ' - '. I think you should take a look at strfind.
Adam
on 23 Feb 2017
You say you want to delete numbers, but then give an example output which still contains the same first line as I thought you wanted to delete?
Accepted Answer
More Answers (1)
Pooja Patel
on 23 Feb 2017
A(1:2)={rand(10,6)}
A =
[10x6 double] [10x6 double]
>> row=2; A{1}(2,:)=[] %delete 1 row from 1 cell
A =
[9x6 double] [10x6 double]
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!