Converting cell array to double?

2 次查看(过去 30 天)
How can I convert the cell array A into the column vector B? (Deleting the letter B and leading white spaces)
A = { 'B 1'; 'B 12'; 'B123' }
B = [ 1; 12; 123 ]

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2016-8-11
编辑:Azzi Abdelmalek 2016-8-11
A = { 'B 1'; 'B 12'; 'B123' }
B=str2double(regexp(A,'\d+','match','once'))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by