replace numeric char within a column
1 回表示 (過去 30 日間)
古いコメントを表示
Hey,
I would like to replace numbers (-999) as char with a 0 for all -999 in a specific column.
Thanks already!
0 件のコメント
採用された回答
Titus Edelhofer
2014 年 7 月 6 日
Hi,
it sounds as if you have a cell array of strings. In this case
allDatabySubj(strcmp(allDatabySubj, '-999)) = {0};
should do the trick.
Titus
1 件のコメント
Image Analyst
2014 年 7 月 6 日
julro's "Answer" moved here since it's not an ANswer/solution to the original question:
Thanks a lot! That was the trick:).
その他の回答 (1 件)
dpb
2014 年 7 月 6 日
x(x(:,colID)==-999,colID)=0;
for your specific column in colID
3 件のコメント
dpb
2014 年 7 月 6 日
It doesn't make any sense and I don't know what was intended by it either but I am guessing it is just poor grammar from non-English native tongue poster...
Image Analyst
2014 年 7 月 6 日
julro's "Answer" moved here since it's not an ANswer/solution to the original question:
Thanks! Char means character, sorry. I am getting the following error message:
>> allDatabySubj(allDatabySubj(:,6)==-999,6)=0; ??? Undefined function or method 'eq' for input arguments of type 'cell'.
参考
カテゴリ
Help Center および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!