フィルターのクリア

Filtering a table containing Hex data

2 ビュー (過去 30 日間)
Matt
Matt 2017 年 6 月 2 日
コメント済み: Jan 2017 年 6 月 2 日
Hi,
I currently have a table (data) containing many different data types however, I am trying to access the rows containing a certain Hex value in a column. Below is everything I have tried so far:
data=
Entry No | Time | Word
---------|-------------|-------
1 | 000:123:456 | 0123
2 | 000:123:457 | A0A0
3 | 000:123:543 | F0F0
4 | 000:124:123 | FFA0
5 | 000:124:987 | 2A0F
Msg = find(strcmp('F0F0', data.Col));
Msg = find(ismember(data.Col,'F0F0'));
Msg = strfind(data.Col, 'F0F0');
Msg = data(data{:, 20} == F0F0,:);
Due to the different datatypes in other columns I also cannot convert the table to an array. If you have any suggestions on how I can do this, that would be great

回答 (1 件)

Jan
Jan 2017 年 6 月 2 日
編集済み: Jan 2017 年 6 月 2 日
Perhaps:
Msg = data(strcmp(data{:, 20}, 'F0F0'), :);
If you post the input data, we could test the suggestions.
  2 件のコメント
Matt
Matt 2017 年 6 月 2 日
Hi Jan,
Thanks for your answer but this gives me a blank table. I have 51 columns in my dataset (obviously the above is just an example) so 'Msg' is a 0x51 table.
Jan
Jan 2017 年 6 月 2 日
@Matt: Please post a samll example of your data, as Matlab code or MAT file. I do not have any idea, where the "20" comes from in your code, so my suggestion is based on pure guessing yet. Give me (and all readers) a chance to solve your problem by posting your data.

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

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by