Borrar filtros
Borrar filtros

While loop has disagreeing matrix dimensions

1 visualización (últimos 30 días)
Craig Johnson
Craig Johnson el 17 de Ag. de 2022
Comentada: Craig Johnson el 17 de Ag. de 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'

Respuesta aceptada

Matt J
Matt J el 17 de Ag. de 2022
while strcmpi(inputMaterial,'steel')

Más respuestas (0)

Categorías

Más información sobre Graphics Objects en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by