How do I create a multiple keywords search engine?

조회 수: 9 (최근 30일)
Brian Kibe
Brian Kibe 2022년 8월 12일
댓글: Brian Kibe 2022년 8월 12일
I am trying to create a multiple keyword search that will allow user to input upto 5 keywords on a display panel and use this data to search for the cell in excel that certisfy this. N/B Only cells with all the keywords certisfy. I would also like the final answer be an new excel file with only the data (raws) that certisfied user input. The user input should not be case sensitive(ignore case). Please help.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 8월 12일
You can get the keywords from the user using any of inputdlg(), uitable(), uicontrol('style', 'edit') or uieditfield()
Once you have the list of keywords you can check cells using contains() or regexp. If you use contains you might want to use the new pattern() facility to "and" together several patterns.
Question: if the user asks for "cat" and the cell contains "scatter" should it match? What if it contains "cats"? If they ask for mouse and the cell contains "mice"? "ever" and the cell contains "when-ever"?
  댓글 수: 1
Brian Kibe
Brian Kibe 2022년 8월 12일
Thank you for your response, but, I'm still unsure on how to use those functions. An example would help.
To answer you question, it shouldn't matter if, for an example, the user asked for 'cat' and matlab outputs cells that even contain 'scatter'. The user will be resposible to decide if they require the data or not after its provided. Also, even though the user is looking for 'mouse' and the cell contains 'mice', they will be resposible to try various ranges of keywords in order to attain reliable data.

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

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by