Escolar Documentos
Profissional Documentos
Cultura Documentos
This document presents MATLAB Sidebars that were developed for supplement the
material presented in the chapters of MEASUREMENT AND DATA ANALYSIS FOR
ENGINEERING AND SCIENCE. The Table of Contents is listed on the next page, followed
by the chapter Sidebars.
All M-files referred to herein are contained within the downloadable file MATLAB
Files on the text web site.
Contents
1 Experiments
2 Electronics
3 Measurement Systems
5 Probability
16
6 Statistics
28
7 Uncertainty Analysis
40
45
9 Signal Characteristics
56
10 Signal Analysis
64
71
12 Technical Communication
73
Chapter 1
Experiments
Chapter 2
Electronics
Figure 3.1:
Chapter 3
Measurement Systems
Chapter 4
Figure 4.1:
10
Figure 4.2:
Figure 4.3:
11
Figure 4.4:
Figure 4.5:
12
Figure 4.6:
13
Figure 4.7:
Figure 4.8:
14
15
Chapter 5
Probability
16
x = 1;
for i = n:-1:2
x = i*x
end
nfac = x
n
n
n
The user-defined function pandc.m computes n!, Pm
, Cm
and Cm(r)
. Its arguments are n and m. With
pandc.m in the MATLAB workspace, simply typing pandc(n,m) will list the desired four values. As an
4
example, typing pandc(4,3) returns the values 24, 24, 4 and 20, corresponding to 4!, P 34 , C34 and C3(r)
,
respectively.
17
Figure 5.1:
18
19
Figure 5.2:
20
21
Figure 5.3:
22
23
Figure 5.4:
24
Figure 5.5:
25
26
27
Chapter 6
Statistics
28
29
30
31
32
33
The MATLAB command cdf can be used to determine the probability, P (z), that a normally
distributed value will be between z. This probability is determined by
P (z) =
p(x)dx
Using this formulation, P (2) = 0.9545. That is, 95.45 % of all normally distributed values be
between z = 2. Further, recalling that MATLABs P (z) denotes the inv value from to z, a
particular value of z can be obtained by typing the command normcdf( 1P
, 0, 1) and of +z by
2
10.9545
,
0,
1).
For
example,
typing
the
command
norminv(
,
0,
1)
gives
the z-value of norminv( 1+P
2
2
2.00. A similar approach can be taken to find P for other distributions.
34
Figure 6.1:
35
Figure 6.2:
36
37
38
Figure 6.3:
39
Figure 7.1:
Chapter 7
Uncertainty Analysis
40
41
42
Figure 7.2:
43
Figure 7.3:
44
Figure 8.1:
Chapter 8
45
x1
x2
..
.
xN
x21
x22
..
.
x2N
..
.
a0
xm
1
a
m
x2 1
a2
..
.
.
..
xm
N
am
y1
y2
y3
..
.
yN
In matrix notation this becomes [X][a] = [Y ], where [X ] is a (N x m+1) matrix, [a] a (m+1 x 1) matrix
and [Y ] a (N x 1) matrix. The solution to this matrix equation is achieved using the command X\Y
after the matrices [X] and [Y ] have been entered.
46
47
Figure 8.2:
48
Figure 8.3:
49
Figure 8.4:
Figure 8.5:
50
Figure 8.6:
Figure 8.7:
51
x1
x1
..
.
xN
y1
y2
..
.
yN
R1
z1
a0
R2
z2 a
1
R3
..
a2 = .
.
..
a3
zN
RN
In matrix notation this becomes [G][a] = [R], where [G] is a (N x 4) matrix, [a] a (4 x 1) matrix and
[R] a (N x 1) matrix. The solution to this matrix equation is achieved using the command G\R after
the matrices [G] and [R] have been entered.
52
53
Figure 8.8:
54
Figure 8.9:
55
Chapter 9
Signal Characteristics
56
Figure 9.1:
57
Figure 9.2:
58
Figure 9.3:
59
60
Figure 9.4:
61
Figure 9.5:
Figure 9.6:
62
63
Chapter 10
Signal Analysis
64
Figure 10.1:
65
66
Figure 10.2:
67
68
Figure 10.3:
Figure 10.4:
69
Figure 10.5:
70
Chapter 11
71
72
Chapter 12
Technical Communication
73
74
75
76
77
78