Effacer les filtres
Effacer les filtres

Converting cell array to double?

2 vues (au cours des 30 derniers jours)
Rightia Rollmann
Rightia Rollmann le 11 Août 2016
Modifié(e) : Azzi Abdelmalek le 11 Août 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 ]

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 11 Août 2016
Modifié(e) : Azzi Abdelmalek le 11 Août 2016
A = { 'B 1'; 'B 12'; 'B123' }
B=str2double(regexp(A,'\d+','match','once'))

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by