powered by
This function adds zeros around a 2D array to get a M x M field.
blowup(x, M, number = 0)
2D array, which should be blown up to a M x M array.
Dimension of new array including zeros at boundaries. M should be larger than max(dim(x)).
Number, that should be added to the incoming array. Default is 0.
Returns the M x M array with the original field in the centre.
# NOT RUN { # Add zeros around a 3x3 matrix to generate a 8x8 matrix. x <- matrix(1:9, nrow = 3) new <- blowup(x = x, M = 8, number = 0) new # }
Run the code above in your browser using DataLab