categorica​lデータから部分一致​する行を特定したい

categoricalデータから特定の文字列が部分一致する行を特定するにはどうすればよいでしょうか。

 채택된 답변

Kazuya
Kazuya 2019년 4월 12일

0 개 추천

一案ですが、いったん string 型に変更して contains 関数で見つける方法ではどうですか?R2016b 以降の MATLABである必要がありますが・・。
Stations = {'S1';'S2';'S1';'S3';'S2'};
Stations = categorical(Stations)
strStations = string(Stations)
idx = contains(strStations, "1"); % 1 を含むデータを検索
Stations(idx)

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 categorical 配列에 대해 자세히 알아보기

태그

질문:

YI
2019년 4월 12일

답변:

2019년 4월 12일

Community Treasure Hunt

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

Start Hunting!