From 0a36938c516fdd45c6d46563e3ea70c6381d45f7 Mon Sep 17 00:00:00 2001 From: aaaakshat <33050725+aaaakshat@users.noreply.github.com> Date: Wed, 3 Nov 2021 16:17:54 -0400 Subject: [PATCH] Add example 10.6 --- ch10.r | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ch10.r b/ch10.r index bbdec77..365ffea 100644 --- a/ch10.r +++ b/ch10.r @@ -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")