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 comentario

Yao Li
Yao Li el 8 de Abr. de 2013
Have you loaded the data from Excel file to matlab?

Iniciar sesión para comentar.

 Respuesta aceptada

Diana
Diana el 9 de Abr. de 2013

0 votos

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

4 comentarios

Yao Li
Yao Li el 9 de Abr. de 2013
Editada: Yao Li el 9 de Abr. de 2013
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 el 11 de Abr. de 2013
I had to change to
find(strcmp(':',char)) so it would work
But it is still returning empty
Yao Li
Yao Li el 11 de Abr. de 2013
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 el 15 de Abr. de 2013
No worries. Can you explain to me what a cell type variable is?

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 8 de Abr. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by