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

 채택된 답변

Stephen23
Stephen23 2015년 11월 20일

0 개 추천

You can use regexp:
>> X = regexp('123.56.128.117','\.','split')
X =
123
56
128
117

추가 답변 (2개)

Shruti Sapre
Shruti Sapre 2015년 11월 20일

1 개 추천

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 2015년 11월 21일

0 개 추천

Thank you very much ur suggestion has solved the probleb
many thanks

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

질문:

2015년 11월 18일

답변:

2015년 11월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by