Hello, I'm supposed to make a code that prompts the user to enter a positive real number to 1 decimal place. I should prompt the user 10 times. This was the code I used.
user_input = fprintf('%.1f', input('Enter a positive real number'));for i = 1:10 if user_input <= 0 user_input = fprintf('%.1f', input('Enter a positive real number')); endend
Best Answer