function Dflag = QCdiameter(d)
% For the first conditional lab you developed a simple conditional statement to 
% test if a shaft’s diameter was between specified limits.   The goal of this 
% problem is to make that code work for a vector.  
%        Input:  		d,   a vector of diameters; 
%        Output:	Dflag, a vector of 1s and 0s in spec or out of spec
%    
% The output vector should be the same length as the input vector.  
% Below is code that can check the limits, enclosed in an incomplete for loop.   
% Add any needed aspects (subscripts/indexes, loop index … ) to make this code work for a vector. 
% All I/O should be at the command line only.
% This is your in-lab assignment due the day of lab, 
% turn as indicated by your instructor. 

%  Your Name ____________________     Today's Date ______________
%  No additional comments required.  
  
  
% Set Quality Limits 
UL = 10.05;
LL = 9.95;
 
for 
% Determine if value is within the limits and return appropriate flag. 
% Dflag = 1 if in spec and Dflag = 0 if out of spec. 
    if d   >=LL && d   <= UL
        Dflag   = 1;
    else
        Dflag  = 0; 
    end
end

end
