Why is it showing Matrix dimensions must agree and how do i fix this?
1 次查看(过去 30 天)
显示 更早的评论
It shows this while i try to implement a while loop. I want the loop to keep repeating until user types the correct variable as written earlier.
0 个评论
采纳的回答
Walter Roberson
2018-4-14
Do not use = or ~= to compare character vectors. Use strcmp() instead.
(With R2016b or later, you can use = and ~= to compare string objects, but you are not using string objects.)
Reminder: we cannot copy and paste a screen snapshot to test with, especially when the screen snapshot cuts off the code.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!