필터 지우기
필터 지우기

extracting numeric vulues from cell char

조회 수: 2 (최근 30일)
Mohamuud hassan
Mohamuud hassan 2015년 5월 14일
답변: Guillaume 2015년 5월 14일
hello every one; who can help me how to extract these email addresses from numeric values which placed before @ character:
km={'ibadal202@gmail.com';'qzaman@msn.com';'dfoorno020@msn.com';'myey@hotmail.com';'qkemal@myspace.com';'zvarfi1013@gmail.com';'vlul010@mynet.com';'uwardo@msn.com';'izaman@hotmail.com';'htimiro@myspace.com';'mfoorno@hotmail.com';'uelo@hotmail.com'}
thanks in advance.

채택된 답변

Guillaume
Guillaume 2015년 5월 14일
Regular expressions are very good for this:
km = {'ibadal202@gmail.com'
'qzaman@msn.com'
'dfoorno020@msn.com'
'myey@hotmail.com'
'qkemal@myspace.com'
'zvarfi1013@gmail.com'
'vlul010@mynet.com'
'uwardo@msn.com'
'izaman@hotmail.com'
'htimiro@myspace.com'
'mfoorno@hotmail.com'
'uelo@hotmail.com'};
numasstring = regexp(km, '\d+(?=@)', 'match', 'once') %find sequence of digits immediately followed by @.
numbers = cellfun(@str2double, numasstring)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by