Hi,
I would like to do this with the attached string array.
CombinedStim(:,2)==k
It is impossible that CombinedStim is string, whereas k is a double.
I tried to use str2double and got NAN values because the first column contains strings, whereas second column is numbers.
Then i try regexp, however I was not succesfull again.
Is there any way I can make this work?
Thank you

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 10 月 17 日
編集済み: Ameer Hamza 2020 年 10 月 17 日

1 投票

What about only converting second column to double
str2double(CombinedStim(:,2)) == k
Or using num2str and then use strcmp()
strcmp(CombinedStim(:,2), num2str(2))

3 件のコメント

Doli Swey
Doli Swey 2020 年 10 月 17 日
Yes, that solves the my question but I understand that the problem was not this at all. I have problem that I dont know now.
Doli Swey
Doli Swey 2020 年 10 月 17 日
thank you
Ameer Hamza
Ameer Hamza 2020 年 10 月 17 日
I am glad to be of help!
You can start a new question of there is some other problem unrelated to current question.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

タグ

質問済み:

2020 年 10 月 17 日

コメント済み:

2020 年 10 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by