Learn R Programming

calcWOI (version 1.0.3)

blowup: Adds zeros around 2D array

Description

This function adds zeros around a 2D array to get a M x M field.

Usage

blowup(x, M, number = 0)

Arguments

x

2D array, which should be blown up to a M x M array.

M

Dimension of new array including zeros at boundaries. M should be larger than max(dim(x)).

number

Number, that should be added to the incoming array. Default is 0.

Value

Returns the M x M array with the original field in the centre.

Examples

Run this code
# 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