Eliminate symbols from char to number
2 次查看(过去 30 天)
显示 更早的评论
How to convert 01-01-01 to 010101? And 01:01:01 to 010101?
0 个评论
采纳的回答
更多回答(1 个)
Pratik Bajaria
2014-8-14
编辑:Pratik Bajaria
2014-8-14
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!