Extrac Part of a cell array
1 回表示 (過去 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!