blowup: Adds zeros around 2D array

Description Usage Arguments Value Author(s) Examples

View source: R/blowup.R

Description

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

Usage

1
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.

Author(s)

Florian Kapp

Examples

1
2
3
4
# 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

calcWOI documentation built on March 31, 2020, 5:21 p.m.