フィルターのクリア

Get the last for digits as the time this message was sent

1 回表示 (過去 30 日間)
flashpode
flashpode 2021 年 9 月 14 日
コメント済み: flashpode 2021 年 9 月 14 日
Hey, I have to get the time that each message was send. The message is like this:ç
"!AIVDM,1,1,,A,13cut>1001P:3LRGa`P@jip400S<,0*410002"
and the las for numbers are minute and second, that was sent at 00 min 02 sec.
i have many of these messages and I have to know when they were sent.
Thank you

採用された回答

Matt J
Matt J 2021 年 9 月 14 日
編集済み: Matt J 2021 年 9 月 14 日
Is this what you want?
str=char( "!AIVDM,1,1,,A,13cut>1001P:3LRGa`P@jip400S<,0*410002" )
str = '!AIVDM,1,1,,A,13cut>1001P:3LRGa`P@jip400S<,0*410002'
str(end-3:end)
ans = '0002'
  1 件のコメント
flashpode
flashpode 2021 年 9 月 14 日
I guess but then put those numbers as 00 min 02 sec

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 9 月 14 日
S = "!AIVDM,1,1,,A,13cut>1001P:3LRGa`P@jip400S<,0*410002"
S = "!AIVDM,1,1,,A,13cut>1001P:3LRGa`P@jip400S<,0*410002"
regexp(S, '\d{4}$', 'match', 'lineanchors')
ans = "0002"

カテゴリ

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