clear;clc;A =input('Enter the Code: ');if A>=0 && A~=inf B = A;else disp('Invalid Code'); while A<0 && A==inf A =input('Enter the Code: ');if A>=0 && A~=inf B = A; break;else disp('Invalid Code');end endend
MATLAB: I want to repeat the input command and the if-else statement. The input has to be positive and must include 0 and not include inf.
if statementMATLABwhile loop
Best Answer