Converting a string array into a number array

6 views (last 30 days)
Please how can l convert '123456789' to [ 1 2 3 4 5 6 7 8 9] in MATLAB

Accepted Answer

KALYAN ACHARJYA
KALYAN ACHARJYA on 13 Feb 2021
Edited: KALYAN ACHARJYA on 13 Feb 2021
#Edited
num_str='123456789'
num_str - '0'
Result:
ans =
1 2 3 4 5 6 7 8 9
  7 Comments
KALYAN ACHARJYA
KALYAN ACHARJYA on 13 Feb 2021
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

Sign in to comment.

More Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!