(Sample Mean and Sample Standard Deviation) Suppose we are given sample data x of size N drawn from a large population. The sample mean and (corrected) sample standard deviation are given by I = N E(Ii – 1)². s = mean_std_dev Function: Input variables: • a vector of data Output variables: • a scalar representing the sample mean of the data a scalar representing the sample standard deviation of the data A possible sample case is: » [mean, std_dev] = mean_std_dev([1 2 3]) mean 2 %3D std_dev 1 %3D » [mean, std_dev] mean_std_dev(randn(10000,1)) mean = 0.00057124 std_dev 1.0016

Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
icon
Related questions
Question

make mathlab code 

**Sample Mean and Sample Standard Deviation**

Suppose we are given sample data \( x \) of size \( N \) drawn from a large population. The sample mean and (corrected) sample standard deviation are given by:

\[
\bar{x} = \frac{1}{N} \sum_{i=1}^{N} x_i
\]

\[
s = \sqrt{\frac{1}{N-1} \sum_{i=1}^{N} (x_i - \bar{x})^2}
\]

**mean_std_dev Function:**

**Input variables:**
- A vector of data

**Output variables:**
- A scalar representing the sample mean of the data
- A scalar representing the sample standard deviation of the data

A possible sample case is:

```
>> [mean, std_dev] = mean_std_dev([1 2 3])
mean = 2
std_dev = 1

>> [mean, std_dev] = mean_std_dev(randn(10000,1))
mean = 0.00057124
std_dev = 1.0016
```

In this function, the sample case demonstrates calculating the mean and standard deviation for a given vector of data. The first example uses a simple data vector `[1 2 3]`, and the second example generates random data with `randn`.
Transcribed Image Text:**Sample Mean and Sample Standard Deviation** Suppose we are given sample data \( x \) of size \( N \) drawn from a large population. The sample mean and (corrected) sample standard deviation are given by: \[ \bar{x} = \frac{1}{N} \sum_{i=1}^{N} x_i \] \[ s = \sqrt{\frac{1}{N-1} \sum_{i=1}^{N} (x_i - \bar{x})^2} \] **mean_std_dev Function:** **Input variables:** - A vector of data **Output variables:** - A scalar representing the sample mean of the data - A scalar representing the sample standard deviation of the data A possible sample case is: ``` >> [mean, std_dev] = mean_std_dev([1 2 3]) mean = 2 std_dev = 1 >> [mean, std_dev] = mean_std_dev(randn(10000,1)) mean = 0.00057124 std_dev = 1.0016 ``` In this function, the sample case demonstrates calculating the mean and standard deviation for a given vector of data. The first example uses a simple data vector `[1 2 3]`, and the second example generates random data with `randn`.
Expert Solution
Mathlab code

Advanced Math homework question answer, step 1, image 1

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Advanced Engineering Mathematics
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
Numerical Methods for Engineers
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
Introductory Mathematics for Engineering Applicat…
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
Mathematics For Machine Technology
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Basic Technical Mathematics
Basic Technical Mathematics
Advanced Math
ISBN:
9780134437705
Author:
Washington
Publisher:
PEARSON
Topology
Topology
Advanced Math
ISBN:
9780134689517
Author:
Munkres, James R.
Publisher:
Pearson,