Question: MATLAB FUNCTION Load the data from file normtemp.txt found using the load() function First, load all three columns of data into a matrix X The

MATLAB FUNCTION

Load the data from file normtemp.txt found using the load() function

First, load all three columns of data into a matrix X

The data is arranged in columns as follows: temperature, sex, age

temp sex age

96.3

96.7

96.9

97

97.1

97.1

97.1

97.2

97.3

97.4

97.4

97.4

97.4

97.5

97.5

97.6

97.6

97.6

97.7

97.8

97.8

97.8

97.8

97.9

97.9

98

98

98

98

98

98

98.1

98.1

98.2

98.2

98.2

98.2

98.3

98.3

98.4

98.4

98.4

98.4

98.5

98.5

98.6

98.6

98.6

98.6

98.6

98.6

98.7

98.7

98.8

98.8

98.8

98.9

99

99

99

99.1

99.2

99.3

99.4

99.5

96.4

96.7

96.8

97.2

97.2

97.4

97.6

97.7

97.7

97.8

97.8

97.8

97.9

97.9

97.9

98

98

98

98

98

98.1

98.2

98.2

98.2

98.2

98.2

98.2

98.3

98.3

98.3

98.4

98.4

98.4

98.4

98.4

98.5

98.6

98.6

98.6

98.6

98.7

98.7

98.7

98.7

98.7

98.7

98.8

98.8

98.8

98.8

98.8

98.8

98.8

98.9

99

99

99.1

99.1

99.2

99.2

99.3

99.4

99.9

100

100.8

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2

70

71

74

80

73

75

82

64

69

70

68

72

78

70

75

74

69

73

77

58

73

65

74

76

72

78

71

74

67

64

78

73

67

66

64

71

72

86

72

68

70

82

84

68

71

77

78

83

66

70

82

73

78

78

81

78

80

75

79

81

71

83

63

70

75

69

62

75

66

68

57

61

84

61

77

62

71

68

69

79

76

87

78

73

89

81

73

64

65

73

69

57

79

78

80

79

81

73

74

84

83

82

85

86

77

72

79

59

64

65

82

64

70

83

89

69

73

84

76

79

81

80

74

77

66

68

77

79

78

77

Then, create a matrix variable temp for just the first column of X, which is the temperature

Generate a histogram with 12 bins

Label the x-axis Temperature

Label the y-axis Frequency

The title should be Temperature for Adult Males and Females

Now explore MATLABs built-in functions to calculate the following quantities for the temperature data.

mean(vector)

median(vector)

mode(vector)

var(vector)

std(vector)

min(vector)

max(vector)

Write a function called mystat.m that takes a vector of data and prints out all these descriptive statistics functions applied to the vector of data, and the length of the data vector. Run your function on the temp vector.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!