Effacer les filtres
Effacer les filtres

While loop has disagreeing matrix dimensions

1 vue (au cours des 30 derniers jours)
Craig Johnson
Craig Johnson le 17 Août 2022
Commenté : Craig Johnson le 17 Août 2022
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'

Réponse acceptée

Matt J
Matt J le 17 Août 2022
while strcmpi(inputMaterial,'steel')

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Objects dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by