Find the string from the cell array
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Gopalakrishnan venkatesan
am 12 Aug. 2015
Bearbeitet: Azzi Abdelmalek
am 12 Aug. 2015
I have a cell array containg a = {'s_ddfa_af' ; 'adfa' ; 'f_dsfa_dasf_sdf'; 'asdf_dd'};
I need to extract the string starting with 's'
When I use regular expression regexpi( a , 's(\w*)' ,'match')
I am getting as {'s_ddfa_af' ; [] ; 'sfa_dasf_sdf' ; 'sdf_dd'}
but i need only the string starting with 's'
How can i do this??
Thanks a lot
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 12 Aug. 2015
Bearbeitet: Azzi Abdelmalek
am 12 Aug. 2015
a = {'s_ddfa_af' ; 'adfa' ; 'f_dsfa_dasf_sdf'; 'asdf_dd'};
out=regexpi(a,'^s\w*','match')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!