How to replace char 'null' in number 0?
Afficher commentaires plus anciens
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 commentaires
Bizzy Dy
le 9 Août 2018
Guillaume
le 9 Août 2018
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
le 9 Août 2018
Guillaume
le 9 Août 2018
Please do not close questions that have been answered.
Réponse acceptée
Plus de réponses (1)
Ameer Hamza
le 9 Août 2018
0 votes
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().
Catégories
En savoir plus sur Design of Experiments (DOE) dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!