From the course: MATLAB Essential Training

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Compare, find, and replace strings

Compare, find, and replace strings - MATLAB Tutorial

From the course: MATLAB Essential Training

Compare, find, and replace strings

- [Instructor] Most aspects of a business stay consistent, but other parts change. For example, you might change the code for a particular product feature and want to update the text in your file. In this movie, I will show you how to compare strings, find substrings within a larger string and replace one string or a substring with another. I will do all of my work inside of a MATLAB command window so you can see what I do in real time. I'll start by defining three variables that I'll use. The first will be string number one, and that will be equal to the lowercase letters xlr. That string is in single quotes and I'll suppress output by putting a semicolon at the end of the line. Now I'll do string two, which will be the same, except all the letters will be capitalized. So uppercase XLR. Close out the string, semicolon and enter, there we go. And finally, string three will be a product code and that will be XLR…

Contents