Explanation

The code compares two character vectors using either the equal to (==) or not equal to (~=) relational operator. MATLAB software returns an error at run time if the vectors being compared are different lengths. Even if MATLAB does not return an error when the code runs, it is likely that this code is inefficient.


Suggested Action

Use the strcmp function instead of a relational operator to compare two pieces of text.