Taking Numerical Values From Char Array

1 view (last 30 days)
I have a char array like
when I use str2num, it gives me squares, not numerical values.
Can you help me to get these values numerically? Thank you.
  1 Comment
Fangjun Jiang
Fangjun Jiang on 6 Jun 2022
What is your actual "char array" data? Use a format that others can copy&paste and use directly in MATLAB.

Sign in to comment.

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 6 Jun 2022
a = 2×6 char array
'123456' '123123'
ans = 2×1
123456 123123

More Answers (0)


Find more on Data Type Conversion 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!

Translated by