Extract Last two Words from strings in cell
Ältere Kommentare anzeigen
A={'There is a world of good you could perform';
'All the money in the world couldnot have saved her';
'W';
'My world'}
Akzeptierte Antwort
Weitere Antworten (1)
>> A = {'There is a world of good you could perform'; 'All the money in the world couldnot have saved her'; 'W'; 'My world'}
A =
'There is a world of good you could perform'
'All the money in the world couldnot have saved her'
'W'
'My world'
>> C = regexp(A,'(\w+\s*){1,2}$','match','once')
C =
'could perform'
'saved her'
'W'
'My world'
Kategorien
Mehr zu Cell Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!