How to find strings in an excel file?

I want to find all colons in an excel file
colons = findstr(char, ':');
colons shows up empty. why is that?

1 件のコメント

Yao Li
Yao Li 2013 年 4 月 8 日
Have you loaded the data from Excel file to matlab?

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

 採用された回答

Diana
Diana 2013 年 4 月 9 日

0 投票

Thanks for your reply
Yes, I did.
I also tried
colons = findstr(string, ':');
Any idea of what could be wrong?

4 件のコメント

Yao Li
Yao Li 2013 年 4 月 9 日
編集済み: Yao Li 2013 年 4 月 9 日
try
find(strcmp(':',string ))
The string here should be a cell matrix loaded from the Excel file. This function returns the location of the colons.
Diana
Diana 2013 年 4 月 11 日
I had to change to
find(strcmp(':',char)) so it would work
But it is still returning empty
Yao Li
Yao Li 2013 年 4 月 11 日
sorry, I think it is not good to use string as the name of the variable.
find(strcmp(':',text_load_from_Excel ))
text_load_from_Excel is a cell type variable loaded from the Excel file
Diana
Diana 2013 年 4 月 15 日
No worries. Can you explain to me what a cell type variable is?

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

その他の回答 (0 件)

タグ

質問済み:

2013 年 4 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by