Changing a string to a number

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.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 5일

0 개 추천

A={1 2 'N/A';3 'B' 5;'N/A' 0 0} %Example
A(strcmp(A,'N/A'))={0}

댓글 수: 2

Jason
Jason 2014년 2월 6일
Thanks, this got me part of the way there, but it doesn't work for tables.
Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 6일
Please post an example

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2014년 2월 5일

댓글:

2014년 2월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by