How to read char '00013' as 13 or '00717' as 717 ? How to skip zero pad ?

1 回表示 (過去 30 日間)
RuiQi
RuiQi 2016 年 12 月 10 日
回答済み: dpb 2016 年 12 月 10 日
How do i read a zero padded number into an integer ?

回答 (1 件)

dpb
dpb 2016 年 12 月 10 日
>> str2num('00013')
ans =
13
>>
Or any of the other ways to parse data; sprintf or any of the other i/o functions depending upon where the string is located.

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by