Error in repeat for loop

4 visualizaciones (últimos 30 días)
Cameron Paterson
Cameron Paterson el 15 de Nov. de 2021
Comentada: Sahil Jain el 18 de Nov. de 2021
while
switch Vehicle Type
case{'compact','Compact'}
fprintf('1')
break
case{'midsize','Midsize'}
fprintf('2')
break
case{'truck','Truck'}
fprintf('3')
break
case{'industrial','Industrial'}
fprintf('4')
break
case{'military','Military'}
fprintf('4')
break
otherwise
fprintf('Vehicle type is not recognized. The program stops. Rerun the program again')
end
end
ive been trying to use the j nxm to get this loop to run five times
  2 comentarios
Jon
Jon el 15 de Nov. de 2021
You don't seem to have your whole code here to show the problem. There is no termination condition following the while and nothing about the "j nxm" you mention at bottom of your question. By the way if you use the Code button on the MATLAB answer toolbar you can cut and paste your code into your question and it will be nicely formatted and ready for someone else to copy and try
Sahil Jain
Sahil Jain el 18 de Nov. de 2021
Could you provide the following information?
  1. What is the termination condition for the "while" loop?
  2. What does "j nxm" refer to?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by