Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. macierz_zgodnosci <- function(rotation) {
  2. square <- function(x) { return (x^2) }
  3. squares_matrix <- apply(rotation, c(1,2), square)
  4. for (row in 1:nrow(squares_matrix)) {
  5. for (col in 2:ncol(squares_matrix)) {
  6. squares_matrix[row, col] <- squares_matrix[row, col] + squares_matrix[row, col - 1]
  7. }
  8. }
  9.  
  10. return(squares_matrix)
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement