splitting cell array consists of string and numeric characters

1 visualización (últimos 30 días)
I have a cell array (n x 1). Each cell looks something like this:
* 2021 3 29 0 0 0.00000000
I need to remove * from each cell and split the cell array into 6 columns consist of double values. For example;
2021 3 29 0 0 0
2021 3 30 0 0 0
.
.
.
How I can do that?

Respuesta aceptada

Wan Ji
Wan Ji el 26 de Ag. de 2021
Editada: Wan Ji el 26 de Ag. de 2021
Use replace
S = {...}; % your n*1 cell array
S = arrayfun(@(i)replace(S{i},'*',''),1:1:numel(S),'uniform',false);
  9 comentarios
Wan Ji
Wan Ji el 26 de Ag. de 2021
You may see n*6 cell is not so good at all compared with DT or DV
sermet OGUTCU
sermet OGUTCU el 26 de Ag. de 2021
Thank you very much for the solution.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays 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