Skip to content

Commit

Permalink
Add example 10.6
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaakshat committed Nov 16, 2021
1 parent 0b9a7c7 commit 0a36938
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ch10.r
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ for (i in 1:20) {
}

matplot(t, x, lwd=2, col="gray")
lines(t, 0.5*cos(2*pi*t), lwd=4, col="darkred")
grid()
lines(t, 0.5*cos(2*pi*t), lwd=4, col="darkred")

## Example 10.6

# R code for Example 10.6
x = matrix(0, 1000, 20)
t = seq(-2, 2, (2+2)/999)

for (i in 1:20) {
x[,i] = cos(2*pi*t+2*pi*runif(1))
}

matplot(t, x, lwd=2, col="gray")
grid()
lines(t, 0*cos(2*pi*t), lwd=4, col="darkred")

0 comments on commit 0a36938

Please sign in to comment.