Converting a string array into a number array

 Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 13 Feb. 2021
Bearbeitet: KALYAN ACHARJYA am 13 Feb. 2021

0 Stimmen

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

7 Kommentare

dzix design
dzix design am 13 Feb. 2021
Thanks sir 🙏🏼. You just saved me much time in a coding problem
Weocome @dzix design I'm glad it helped
dzix design
dzix design am 13 Feb. 2021
May l have your WhatsApp number Sir?
KALYAN ACHARJYA
KALYAN ACHARJYA am 13 Feb. 2021
Bearbeitet: KALYAN ACHARJYA am 13 Feb. 2021
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
dzix design
dzix design am 13 Feb. 2021
@jan thanks 🙏🏼

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by