Guest User

Untitled

a guest
Oct 23rd, 2019
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data