Taking Numerical Values From Char Array

1 次查看(过去 30 天)
Hello,
I have a char array like
'123456'
'123123'
when I use str2num, it gives me squares, not numerical values.
'□□□□□□'
'□□□□□□'
Can you help me to get these values numerically? Thank you.
  1 个评论
Fangjun Jiang
Fangjun Jiang 2022-6-6
What is your actual "char array" data? Use a format that others can copy&paste and use directly in MATLAB.

请先登录,再进行评论。

采纳的回答

Fangjun Jiang
Fangjun Jiang 2022-6-6
a=['123456'
'123123']
a = 2×6 char array
'123456' '123123'
str2num(a)
ans = 2×1
123456 123123

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by