Taking Numerical Values From Char Array

1 visualización (últimos 30 días)
tinkyminky93
tinkyminky93 el 6 de Jun. de 2022
Comentada: Fangjun Jiang el 6 de Jun. de 2022
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 comentario
Fangjun Jiang
Fangjun Jiang el 6 de Jun. de 2022
What is your actual "char array" data? Use a format that others can copy&paste and use directly in MATLAB.

Iniciar sesión para comentar.

Respuesta aceptada

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

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by