Hi I have a string array as following:
'15:30:00'
'15:30:01'
'15:30:02'
'15:30:03'
'15:30:04'
'15:30:05'
'15:30:06'
ETC.....
I want the out put to be like 153000
153001
153002
153003
etc,
any help

 Respuesta aceptada

Jan
Jan el 21 de Feb. de 2012

0 votos

S = {'15:30:00'; '15:30:01'; '15:30:02'};
S = strrep(S, ':', '');
D = sscanf(sprintf('%s ', S{:}), '%d');

Más respuestas (1)

Sean de Wolski
Sean de Wolski el 21 de Feb. de 2012

1 voto

s = '15:30:00';
sn = str2double(s(isstrprop(s,'digit')))

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 21 de Feb. de 2012

Editada:

el 19 de Oct. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by