필터 지우기
필터 지우기

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.

채택된 답변

Walter Roberson
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
Walter Roberson 2018년 4월 14일
if ~ismember(gh, {'f', 'in', 'fe', 'mi', ...})
disp(...)
...
end

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by