Eliminate symbols from char to number
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
NG
le 14 Août 2014
Réponse apportée : Andrei Bobrov
le 14 Août 2014
How to convert 01-01-01 to 010101? And 01:01:01 to 010101?
0 commentaires
Réponse acceptée
Andrei Bobrov
le 14 Août 2014
out0 = regexp('01-01-01','\d*','match');
out = [out0{:}];
0 commentaires
Plus de réponses (1)
Pratik Bajaria
le 14 Août 2014
Modifié(e) : Pratik Bajaria
le 14 Août 2014
Here's a workaround for this.
hypind=find(p=='-');
cnt=0;
cntp=1;
for i=1:size(p,2)
if i==hypind(cntp)
if cntp<size(hypind,2)
cntp=cntp+1;
end
else
cnt=cnt+1;
pfinal(cnt)=p(i);
end
end
Similarly, you can do for ' : '. Hope this helps.
Please let me know incase of further doubts.
Regards, Pratik
0 commentaires
Voir également
Catégories
En savoir plus sur Number Theory 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!