Accelerating the pace of engineering and science

# normspec

Normal density plot between specifications

## Syntax

normspec(specs)
normspec(specs,mu,sigma)
normspec(specs,mu,sigma,region)
p = normspec(...)
[p,h] = normspec(...)

## Description

normspec(specs) plots the standard normal density, shading the portion inside the specification limits given by the two-element vector specs. Set specs(1) to -Inf if there is no lower limit; set specs(2) to Inf if there is no upper limit.

normspec(specs,mu,sigma) shades the portion inside the specification limits of a normal density with parameters mu and sigma. The defaults are mu = 0 and sigma = 1.

normspec(specs,mu,sigma,region) shades the region either 'inside' or 'outside' the specification limits. The default is 'inside'.

p = normspec(...) also returns the probability, p, of the shaded area.

[p,h] = normspec(...) also returns a handle h to the line objects.

## Examples

expand all

### Create a Normal Density Plot

This example shows how to create a normal density plot.

A production process fills cans of paint. The average amount of paint in any can is 1 gallon, but variability in the process produces a standard deviation of 2 ounces (2/128 gallons). What is the probability that the cans will be filled under specification by 3 or more ounces?

```p = normspec([1-3/128,Inf],1,2/128,'outside')
```
```p =

0.0668

```