Filter löschen
Filter löschen

Converting cell array to double?

2 Ansichten (letzte 30 Tage)
Rightia Rollmann
Rightia Rollmann am 11 Aug. 2016
Bearbeitet: Azzi Abdelmalek am 11 Aug. 2016
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 ]

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 11 Aug. 2016
Bearbeitet: Azzi Abdelmalek am 11 Aug. 2016
A = { 'B 1'; 'B 12'; 'B123' }
B=str2double(regexp(A,'\d+','match','once'))

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by