How i can reading character letter by letter
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Stephen23
2015-11-20
You can use regexp:
>> X = regexp('123.56.128.117','\.','split')
X =
123
56
128
117
0 个评论
更多回答(2 个)
Shruti Sapre
2015-11-20
Hi Gaseb,
Here are two functions that may help achieve the required result:
1. Using "strsplit":
2. Using "strtok"
Hope this helps!
-Shruti
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!