Extract numbers from cell array
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I have a cell array with both numbers and 'NA' strings for missing values.
Now I want to convert the cell array to a pure number array to use it for calculations, keeping all numbers and setting the 'NA' to NaN.
What would be the easiest way to achieve that?
Best regards,
Chris
0 comentarios
Respuesta aceptada
Walter Roberson
el 16 de Abr. de 2012
A(cellfun(@ischar,A)) = {NaN};
Amat = cell2mat(A);
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Types en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!