slapply function

Apply a function to a big matrix by slicing