Hi,
How can I find out if a certain word, e.g. 'oranges' is contained within an excel sheet? I can't use ismember as for some reason, the string has to be stored in a vector.
Thanks :)

답변 (1개)

Image Analyst
Image Analyst 2022년 6월 21일

0 개 추천

Not sure why you can't use ismember. Did you try readcell, strfind, and contains?

댓글 수: 4

Davindra Usov
Davindra Usov 2022년 6월 21일
Thank you for your reply. My table is a 30x300 table full of strings/chars. I tried to use: contains(g,'LATITUDES'), where g is the table but I get this error: Error using contains
Search term must be a text or pattern array.
I thought my search term is already text?
Image Analyst
Image Analyst 2022년 6월 21일
The search term is a string but g is a table.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Davindra Usov
Davindra Usov 2022년 6월 21일
Hi,
So i've managed to fix it my converting the table to an array. Then used 'find' to locate the indices. However, I'm now stuck on using readtable to read in an excel file with multiple sheets. I can't attach my code as it's confidental. The amount of info I've given is what's allowed but I can't send the code itself :(
Davindra Usov
Davindra Usov 2022년 6월 21일
Also, thank you very much for your response

댓글을 달려면 로그인하십시오.

카테고리

제품

릴리스

R2021b

태그

질문:

2022년 6월 20일

댓글:

2022년 6월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by