Extrac Part of a cell array
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a cell array like a = {'danny_820','richard_320','Tom_500','Fred_120'}. Please how do i extract the numbers so that i will be left with
{820,320,500,120}
Thanks
댓글 수: 0
답변 (1개)
Stephen23
2019년 5월 28일
>> a = {'danny_820','richard_320','Tom_500','Fred_120'};
>> str2double(regexp(a,'\d+$','once','match'))
ans =
820 320 500 120
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!