Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

For Loop. My goal is for my code to recognize if the user inputs an empty 'grade' and then to loop back into itself until the user enters 10 grade values individually.

1 Ansicht (letzte 30 Tage)
  9 Kommentare
Owen Jansen
Owen Jansen am 15 Okt. 2020
It does, but then it doesn't fill the matrix. Each loop will overwrite the last with the most recent grade input.

Antworten (1)

Rik
Rik am 15 Okt. 2020
I would suggest using a cell array initially, which you can convert to a normal array after the loop. That way you can use the isempty function to check for an empty input.
Since you don't know how often you need to retry, I would suggest a while loop.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by