How to replace char 'null' in number 0?
이전 댓글 표시
Hi! I`ve got a problem with using plot function cause there is some 'null's (char type) in my data files . So i would like to change/replace that nulls in 0 (num) . Could someone help to find useful function or to offer other solution.
댓글 수: 6
Bizzy Dy
2018년 8월 9일
Guillaume
2018년 8월 9일
It would be much simpler to fix the way you're reading the file rather than trying to fix the problem after the fact.
For that we would need to see the code you're using (not a screenshot, an actual copy as text) and a sample file (again not a screenshot!)
Bizzy Dy
2018년 8월 9일
Guillaume
2018년 8월 9일
Please do not close questions that have been answered.
채택된 답변
추가 답변 (1개)
Ameer Hamza
2018년 8월 9일
0 개 추천
The image shows a struct which char arrays as fields. You can use strrep() to replace the elements of a char array. Although it will still not work with the plot() function because the elements are char arrays, not numeric values. You might need to use str2num() to convert char values t numeric before using plot().
카테고리
도움말 센터 및 File Exchange에서 Design of Experiments (DOE)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!