Borrar filtros
Borrar filtros

How i can reading character letter by letter

3 visualizaciones (últimos 30 días)
Gaseb Alotibi
Gaseb Alotibi el 18 de Nov. de 2015
Respondida: Gaseb Alotibi el 21 de Nov. de 2015
i have this variable x='123.56.128.117' as a char and i want to save each part that divided by '.' in a different variable. the problem is the size of each part is not fixed that why i face a problem. could you help me pls is there a function that can read the character and when it find '.' save or return size

Respuesta aceptada

Stephen23
Stephen23 el 20 de Nov. de 2015
You can use regexp:
>> X = regexp('123.56.128.117','\.','split')
X =
123
56
128
117

Más respuestas (2)

Shruti Sapre
Shruti Sapre el 20 de Nov. de 2015
Hi Gaseb,
Here are two functions that may help achieve the required result:
1. Using "strsplit":
2. Using "strtok"
Hope this helps!
-Shruti

Gaseb Alotibi
Gaseb Alotibi el 21 de Nov. de 2015
Thank you very much ur suggestion has solved the probleb
many thanks

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by