필터 지우기
필터 지우기

While loop has disagreeing matrix dimensions

조회 수: 1 (최근 30일)
Craig Johnson
Craig Johnson 2022년 8월 17일
댓글: Craig Johnson 2022년 8월 17일
Problematic code:
inputMaterial=input('Enter Tuning Fork Material:')
materialValidation=0;
InputError=1;
while inputMaterial == 'steel' | inputMaterial == 'Steel'
materialValidation=materialValidation-1;
InputError=0;
fprintf('Choice of material: %d','forkMaterial')
break
end
Output:
inputMaterial =
'aluminum'
Matrix dimensions must agree.
Error in PP_SUM22 (line 4)
while inputMaterial == 'steel' | inputMaterial == 'Steel'

채택된 답변

Matt J
Matt J 2022년 8월 17일
while strcmpi(inputMaterial,'steel')

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by