Extract Last two Words from strings in cell
Mostrar comentarios más antiguos
A={'There is a world of good you could perform';
'All the money in the world couldnot have saved her';
'W';
'My world'}
Respuesta aceptada
Más respuestas (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'
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!