How to delete string in cell arrays?
이전 댓글 표시
I want to delete this strings in a cell arrays and this strings appeared at 590 columns, sometime in 609 column. I tried this. It worked but it doesn't delete anything. Thanks in advance for helping.
c = {'Time','DOY','VWC05','VWC10','VWC20','VWC50','T05','T10','T20','T50','PAW40','PAW65';'#','#','cm^3/cm^3','cm^3/cm^3','cm^3/cm^3','cm^3/cm^3','°C','°C','°C','°C','mm','mm'}% cell array of strings
row_to_delete = all( cellfun(@(c) ischar(c) && strcmp(c,'Time'), SMdate), 1);
SMdate(row_to_delete, :) = [];
댓글 수: 3
Walter Roberson
2016년 2월 25일
Note that the 'c' you define in the first line has no relationship to the 'c' of the second line, because the c in the second line is the parameter name for the anonymous function.
Sonisa
2016년 2월 25일
Muhammad Usman Saleem
2016년 2월 26일
@Sonisa if you find solution of your question then please accept answer of @walter for reward of assistance
채택된 답변
추가 답변 (1개)
Muhammad Usman Saleem
2016년 2월 25일
0 개 추천
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!