Professional Documents
Culture Documents
PowerPoint to accompany
Introduction to MATLAB
for Engineers, Third Edition
Chapter 7
Statistics, Probability,
and Interpolation
(Module 9)
Copyright 2010. The McGraw-Hill Companies, Inc. This work is only for nonprofit use by instructors in courses for which this textbook has been adopted.
Any other use without publishers consent is unlawful.
7-2
7-4
How do
you think
this
compares
to 20
tests?
7-5
7-6
7-7
7-8
Command
Description
bar(x,y)
histogram(y)
histogram(y,n)
histogram(y,x)
[z,edges] =
histcounts(y)
7-9
7-10
7-11
7-12
7-13
7-14
7-15
7-16
2
See pages 305-306.
7-17
7-19
Unrepresentative
0.01% of the people in Aust
All of Toowoomba to
represent all of Australia
7-18
7-20
u = x + y
(7.24)
= x y
(7.25)
u==x+y
Command
Description
rand
rand(n)
rand(m,n)
rng(s)
rng(0)
rng(shuffle)
(7.26)
7-21
7-22
randn(n)
randn(m,n)
rng(s)
rng(0)
rng(shuffle)
randperm(n)
7-23
7-24
>>rng(0)
>>rand
ans =
0.8147
>>rand
ans =
0.9058
>>rng(0)
>>rand
ans =
0.8147
>>rand
ans =
0.9058
>>s = rng;
>>rng(s)
>>rand
ans =
0.9058
>>rng(s)
>>rand
ans =
0.9058
(7.31)
7-25
7-26
(7.33)
(7.32)
y = bx + c
(7.34)
y = |b|x
(7.35)
y = 3*randn(1,2000) + 5.
7-28