Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- macierz_zgodnosci <- function(rotation) {
- square <- function(x) { return (x^2) }
- squares_matrix <- apply(rotation, c(1,2), square)
- for (row in 1:nrow(squares_matrix)) {
- for (col in 2:ncol(squares_matrix)) {
- squares_matrix[row, col] <- squares_matrix[row, col] + squares_matrix[row, col - 1]
- }
- }
- return(squares_matrix)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement