Question: Need help with this matlab question, code is already in place for certian parts. 4. Using the for loop The Quality department will measure the

Need help with this matlab question, code is already in place for certian parts.
4. Using the for loop The Quality department will measure the diameter of shafts machined in their factory. They determined a sample of 100 shafts will be measured by four technicians. The measurements are saved in a matrix named data and saved in a file named Shaft_Diameter.mat The matrix data has 100 rows corresponding to the diameter of each shaft. The matrix data has 4 columns corresponding to each technician. Your are to write a funcion named calc_average that calculates the average diameter of the 100 shafts for each technician. You must use a for loop in the function to calculate the average diameters and do not use MATLAB built in function mean) You may use the built-in MATLAB function mean() to check your for loop answwer. But you cannot use mean) in your function. Your Function Reset E MATLAB Documentation function y = calc-average(y) 2 % input variable y is a matrix 31% output variable x is vector 41% x is average of columns of y 19 end % function end statement Code to call your function C Reset load Shaft_Diameter 2% call your function named x = calc-average(y) s ave_diamcalc_average(data)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
