Good practice in conditional test with categorical variable
显示 更早的评论

So I defined a categorical variable and tested its value in a conditional statement using the "==" operator, as seen in the image. The program works OK, thus I'm guessing such syntax is acceptable. But I kept getting warnings like the one in the image in the MATLAB IDE. How can my code be changed so that the warning is suppressed, and what is the underlying explanation for what is and is not a good practice when dealing with categorical variables in a conditional test?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Get Started with MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
