Borrar filtros
Borrar filtros

Converting cell array to double?

2 visualizaciones (últimos 30 días)
Rightia Rollmann
Rightia Rollmann el 11 de Ag. de 2016
Editada: Azzi Abdelmalek el 11 de Ag. de 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 ]

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 11 de Ag. de 2016
Editada: Azzi Abdelmalek el 11 de Ag. de 2016
A = { 'B 1'; 'B 12'; 'B123' }
B=str2double(regexp(A,'\d+','match','once'))

Más respuestas (0)

Categorías

Más información sobre Data Types en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by