Error using == Matrix dimensions must agree.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I want a solution to this problem. Someone can help me?
Error in operations (line 5)
elseif c == 'multi'
댓글 수: 0
채택된 답변
Star Strider
2015년 5월 30일
I have no idea what the matrix dimension problem is, since we have only one line of your code. However, the way to compare strings and string variables is to use the strcmp or strcmpi functions.
So the correct syntax for the line you posted would be:
elseif strcmpi(c, 'multi')
댓글 수: 7
추가 답변 (1개)
Pronoy Das
2021년 2월 25일
편집: Pronoy Das
2021년 2월 25일
I came across a similar problem. Simply replace the single quotation marks with the double quotation marks, i.e. replace the line in your code with
c == "multi"
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!