Extracting specific data from table

16 ビュー (過去 30 日間)
Tiago André
Tiago André 2022 年 5 月 12 日
コメント済み: Tiago André 2022 年 5 月 12 日
Hi, hope you doing well.
I have a 1698997x4 table in matlab. The first column is the variable "ID" and it stores the name of multiple sensors, for example "ILM_I12" or "APM_50" . I need to extract from the table all the rows where the ID is a match for "ILM".
I tried the following code but got the the error "Undefined function 'eq' for input arguments of type 'cell'."
SensorILM = valores_sensores(valores_sensores.ID == 'ILM_*',:)
Feel free to suggest other methods, if you dont think this is the right one. Any help is appreciated.
Thank you!

採用された回答

Stephen23
Stephen23 2022 年 5 月 12 日
idx = startsWith(valores_sensores.ID,'ILM_'); % or CONTAINS
SensorILM = valores_sensores(idx,:)
  1 件のコメント
Tiago André
Tiago André 2022 年 5 月 12 日
It worked, thanks!

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

その他の回答 (0 件)

カテゴリ

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