Convert String to numbers

Hey I've got a problem. I have to convert a String (200x1) that each line has four numbers:
0000
0001
0002
0003
...
...
...
to number, to be able to do operations. I used str2num but it comes error: Input must be a character vector or string scalar.

Respuestas (1)

Sean de Wolski
Sean de Wolski el 16 de Sept. de 2021
s = ["0001" "0002"]
s = 1×2 string array
"0001" "0002"
n = double(s)
n = 1×2
1 2

1 comentario

flashpode
flashpode el 16 de Sept. de 2021
I do not want to change the 0000 0001 and those numbers I just want to operate with them

Iniciar sesión para comentar.

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Preguntada:

el 16 de Sept. de 2021

Comentada:

el 16 de Sept. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by