Question
In Matlab, how can you code that if a string has any of a certain set of specific words, to replace them with a different
In Matlab, how can you code that if a string has any of a certain set of specific words, to replace them with a different word. For example, the first set of "problem" words, {'Joe' 'coffee' and 'chocolate' } are found from text file 1 and their replacement words are found from text file 2 in the format of the problem word first followed by the replacement (< problemword >: < replacement >). Each text file can have these words multiple times in them throughout the file and they can be on the same line as well. I made a switch case, but I don't know how to actually find where these words are and replace the words with the replacement words after pulling them out of text file 2.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started