Jensen_HW#6.pdf

# Not only is the standard deviation smaller than that

• 5

This preview shows pages 3–5. Sign up to view the full content.

diameter of 16 mm. Not only is the standard deviation smaller than that of production line A, but the mean (average), median, and mode of production line B is closer to 16 mm than that of production line A.

This preview has intentionally blurred sections. Sign up to view the full version.

Name: Grant Jensen AERE 161, Spring 2018 HW #6 Due date: 03/07/2018 Problem 14.4 meanw_o_minmax.m function [meanvec_w_o_maxandmin] = meanw_o_minmax(vec) %Grant Jensen, AER E 161, Homework #6, Problem 14.4 %meanw_o_minmax returns the mean of the values in a vector, not including the minimum and maximum values. % To call the function: meanw_o_minmax(vec) % Where vec is a vector [x1, y1] = min(vec); %Finds and gives the coordinates of the minimum value of the vector vec(y1) = []; %Blanks, or removes, the value at the coordinates of the minimum value given by the line above [x2, y2] = max(vec); %Finds and gives the coordinates of the maximum value of the vector vec(y2) = []; %Blanks, or removes, the value at the coordinates of the maximum value given by the line above meanvec_w_o_maxandmin = mean(vec); %This calculates the mean of the vector without it's outliers end twomeans_14_4.m clear,clc %Grant Jensen, AER E 161, Homework #6, Problem 14.4 %Tests the function meanw_o_minmax %Creates a vector of 10 random integers from 0 to 50 vec = randi([0,50],1,10) %Just for fun, this displays the mean of the unedited vector average = mean(vec); fprintf( 'The mean with outliers of the vector vec is: %f\n' ,average) %This next line calls the function meanw_o_minmax and calculates a more %accurate mean, as the outliers are not existent in this one. accuratemean = meanw_o_minmax(vec); fprintf( 'The mean without outliers of the vector vec is: %f\n' ,accuratemean) Output: vec = 33 1 43 47 34 38 37 20 33 8 The mean with outliers of the vector vec is: 29.400000 The mean without outliers of the vector vec is: 30.750000
Name: Grant Jensen AERE 161, Spring 2018 HW #6 Due date: 03/07/2018 Problem 14.8 clear,clc %Grant Jensen, AER E 161, Homework #6, Problem 14.8 %Mean vs median to replace a test score scores1 = [99,88,95] scores2 = [99,70,77] mean1 = mean(scores1);
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern