Last active
June 6, 2019 18:07
-
-
Save phelipetls/ad7bd867a480bed9a6fa4fa344dd54e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gerar uma sequência de -2pi até 2pi, com discretização de 2000 | |
t <- seq(from = -2*pi, to = 2*pi, length.out = 2000) | |
# função para gerar os valores de x | |
X <- function(t, a, A = 1, d = pi/2) { | |
A*sin(a*t+d) | |
} | |
# para gerar os valores de y | |
Y <- function(t, b, B = 1) { | |
B*sin(b*t) | |
} | |
# parâmetros para gerar os gráficos em um plot device | |
# com 4 linhas e 4 colunas | |
par(mfrow = c(4, 4)) | |
# plotar 16 vezes os pontos gerados com aquelas funções | |
for(i in 1:16) { | |
a <- sample(1:10, 1) | |
b <- sample(1:10, 1) | |
plot(X(t, a), Y(t, b), main = paste0("a: ", a, " b: ", b)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment