フィルターのクリア

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 Center および File ExchangeGraphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by