Changing a string to a number
Mostrar comentarios más antiguos
I have a table that contains both numerical values as well as text. I would like to replace the string 'N/A' to the number 0 in the table.
Thanks for helping out a true beginner.
Respuestas (1)
Azzi Abdelmalek
el 5 de Feb. de 2014
A={1 2 'N/A';3 'B' 5;'N/A' 0 0} %Example
A(strcmp(A,'N/A'))={0}
2 comentarios
Jason
el 6 de Feb. de 2014
Azzi Abdelmalek
el 6 de Feb. de 2014
Please post an example
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!