Converting a string array into a number array

 채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 2월 13일
편집: KALYAN ACHARJYA 2021년 2월 13일

0 개 추천

#Edited
num_str='123456789'
num_str - '0'
Result:
ans =
1 2 3 4 5 6 7 8 9

댓글 수: 7

Thanks sir 🙏🏼. You just saved me much time in a coding problem
Weocome @dzix design I'm glad it helped
May l have your WhatsApp number Sir?
KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 2월 13일
편집: KALYAN ACHARJYA 2021년 2월 13일
Available in the profile description, but I rarely reply to unknown.
:)
The is no reason to apply num2str(), when the variable is a CHAR vector already. Easier:
num_str = '123456789'
result = num_str - '0'
Yes sir @Jan Thanks, In day time, I have answered a similar question, which first required changing num2str, so I used it here by mistake.
Your teaching is very valuable, thank you and much appreciation
@jan thanks 🙏🏼

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

추가 답변 (0개)

카테고리

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

질문:

2021년 2월 13일

댓글:

2021년 2월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by