function V=P4_numgenTP1_2017(9801081)
randn(‘seed’,98.0108);
rand(‘seed’,108.9009);
A1=[50,100,200,500,1000,2000,5000];
A=A1(randi(7));
B=(randi(15)+5)/400;
%V=(randn(1,50)*(rand()*20+5)/300+(1+(randi(2)*2-3)*(rand()+0.2)/100)^2)*A;
V=(randn(1,100)*(rand()*20+5)/300+(1+(randi(2)*2-3)*(rand()+0.2)/100)^2)*A;
fprintf(‘nmu=%gnnalpha=%gnnn=%gnnm=%gnn’,A,A*B,20+round(rand()*1000)/100,35+round(rand()*1000)/100);
end
You are in charge of the Quality Control systems for a resistor production line. The key process in the production line requires a resistor to be within a specific range of resistance. If the resistance lies outside this range, it is defective Run P4 numgenTP1 2017. m in MATLAB with your student number to generate your data for this portfolio. The code will output: the data of measured resistances for 100 units of the resistor Au i.e. mul a e. alpha Your tasks: 1. Write one MATLAB function that calculates and returns the sample mean (T) and sample variance (s?) of your data, using a while loop. Do not use the built-in functions mean and var. Provide the MATLAB function as a separate .m file and the resulting mean and variance. 2. The process is supposed to have a mean value of w (i.e. mu as per printout from P4 numgenTP1 2017.m). There are concerns that the system may be incorrectly calibrated. To determine if there is sufficient evidence to support the concerns: (a) find the 95% confidence interval for the mean value Au (b) perform a hypothesis test.