I have a question about delete the specific raw in a mat file. I have a mat file like this (it is a cell)
'Enabled' 1 5.8
'Disabled' 0 2.1
'Enabled' 1 0.2
'Enabled' 1 6.4
'Enabled' 1 2.1
'Enabled' 1 12.5
...
I want to delete the raw if the number at column 3 is larger than 5. Namely, I will delete raw 1, raw 4 and raw 6 in this case since the corresponding number at column 3 are 5.8, 6.4 and 12.5, respectively (larger than the constraint 5). Then the remainding data will construct a new mat file, like that
'Disabled' 0 2.1
'Enabled' 1 0.2
'Enabled' 1 2.1
...
How to realize that? Thanks a lot!

 채택된 답변

madhan ravi
madhan ravi 2019년 7월 29일

0 개 추천

c(cell2mat(c(:,3))>5,:) = [] % where c is your cell array

추가 답변 (0개)

카테고리

제품

릴리스

R2018b

질문:

2019년 7월 29일

댓글:

2019년 7월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by