How can I separate data that does not fit the required format?

1 回表示 (過去 30 日間)
Joey Menicucci
Joey Menicucci 2020 年 12 月 10 日
コメント済み: Joey Menicucci 2020 年 12 月 12 日
Hello,
I'm writing a script that processes hex data from a force/torque sensor. Each reading is a row of 25 characters in the following format:
7FFBC0011FF4200000000FFFC
Every once in a while I'll get a bad reading that looks like the following:
3FFBC00ý“”“&&LL˜˜00FFFC
Note: These bad readings still have 25 characters similar to the good data.
I want to write something that will separate these rows from the rest of the data. What would be the best way to do this?
Maybe something that finds rows that have non-letter and non-integer characters?
Any help is appreciated! Thanks in advance!

採用された回答

Timo Dietz
Timo Dietz 2020 年 12 月 10 日
Maybe I didn't get your issue, but what about using "contains" and searching for a specific identifier?
E.g. contains([your_hex_array], '&') gives you all indices of an array containing the character '&'
  1 件のコメント
Joey Menicucci
Joey Menicucci 2020 年 12 月 12 日
I think this is the simple answer I was looking for. Thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by