using less than operator and combination of if and for statement
Show older comments
I'm trying to use the less than operator and getting the following error (for vertical Height 102 Error: Invalid operator use). also Is the for and if statement combination I'm using correct?
%calculate Rim to disc ratio
shortestRimLength=minDistance;
DiameterOfDisc=verticalHeight
%Rim to disk ratio estimation
RDR=shortestRimLength./DiameterOfDisc;
for DiameterOfDisc<102
if RDR>0.4
disp('NORMAL')
msgbox('NORMAL')
elseif RDR <0.2 && RDR>=0.4
disp('EARLY GLAUCOMA ')
msgbox('EARLY GLAUCOMA ')
else RDR<=0.2;
disp(' ADVANCED GLAUCOMA ')
msgbox(' ADVANCED GLAUCOMA ')
end
Accepted Answer
More Answers (1)
Fifteen12
on 3 Dec 2022
Your for loop is using a conditional as its input. In MATLAB you need to specify a list.
Try:
for DiameterOfDisc = 1:102
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!