Match Substring in Cell Array and Copy To New Array
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
0 votes
Share a link to this question
- school of medecine university of CA in Los Angeles
- engineering programs in california
- University of CA in Los Angeles degrees
- University of CA in Irvine nursing online studies
- rankings of universities in california
- school of mathematics UCLA
- financial aid UCLA
- UCLA minorities financial aid
Accepted Answer
1 vote
- "substring start" doesn't match "ucla_financial= [ financial aid UCLA UCLA minorities financial aid ]". The example suggests that you search strings, which contain the two words: financial and UCLA, not a substring
- The example "ucla_programs= [ school of medecine university of CA in Los Angeles school of mathematics UCLA ]" is not helpful. The word, programs, doesn't appear in the selected strings.
11 Comments
- Is there away to filter out bogus strings, such as "university a" or "university s," more specifically filter out any strings which contain a single letter before or after the keyword? For example, the function shouldn't return "university a" nor "university s"
- Having the function search more than one word? Right now for 'university' and 'college' it only runs once for 'university' and exits.
- Store the output of the function as an array in the main script? "university_arr= search_sub(keywords, search_term)" doesn't work.
- all( ismember( cas1, cas2 ) ) in the function, search_sub, assumes that both arguments are cell array of strings. current_keyword{ii} is a string in the function, sub_search
- ismember is case sensitive
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Products
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)