Why is it showing Matrix dimensions must agree and how do i fix this?
조회 수: 1 (최근 30일)
이전 댓글 표시
Abhey Pal Singh Kumar
2018년 4월 14일
댓글: Abhey Pal Singh Kumar
2018년 4월 14일
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.
댓글 수: 3
Walter Roberson
2018년 4월 14일
if ~ismember(gh, {'f', 'in', 'fe', 'mi', ...})
disp(...)
...
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!