Using string compare on imported data
古いコメントを表示
I am very new to Matlab and have only ever used maple. I am trying to use string compare on huge imported data (26,000 rows) to a specific word to find the row that contains it.
I understand the basics of strcmp and can use it within matlab, but cannot figure out how to use it for a data set. So for example, I am currently working with the code:
s1 = 'RT'; s2 = {ImpD(:,4)}; TF = strcmp(s1, s2); find(TF);
ImpD(:,4) since I am looking for the specific text in the 4th column. I just don't think Matlab is realizing I am referencing the imported data. How can i fix this?
6 件のコメント
Guillaume
2018 年 2 月 11 日
what is
class(ImpD)
and if it cell, what is
class(ImpD{1, 4})
Jacob Barrett-Newton
2018 年 2 月 11 日
Jacob Barrett-Newton
2018 年 2 月 11 日
Jacob Barrett-Newton
2018 年 2 月 11 日
Guillaume
2018 年 2 月 11 日
Is it string or char array? People use the two interchangeably but they are actually two very different types. comparisons are easier with strings.
Since ImpD is a table, what is the name of the fourth column?
Jacob Barrett-Newton
2018 年 2 月 11 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!