mat.size | R Documentation |
Transforms a matrix called org
, represented by \mathbf{Z} = (z_{ij})_{p\times q}
, using a matrix called mask
, represented by \mathbf{M} = (m_{ij})_{p \times q}
.
Both matrices, org
and mask
have the same dimensionality, i.e. p \times q
.
org
is real or complex, but mask
is necessarily boolean, i.e. \mathbf{Z} \in \mathbb{C}^{p\times q}\,\wedge \, \mathbf{M}\in\mathbb{B}^{p\times q}
.
mat.size
weans org
down to the bare minimum size equivalent to mask
, but does NOT etch the org
at all.
This is the difference between mat.size
and mat.mask(org, mask, drop.dat = T)
.
See also mat.mask and description
mat.size(org, mask)
org |
The original data |
mask |
The masking matrix |
mat.size
doesn't etch the matrix org
, only sizes it.
Please see figure below.
The returned value is always a matrix
Chitran Ghosal
##3.build the function
para <- function(X, Y){
return((X^2 + Y^2) - (X^2 + Y^2) + 1)
}
##convert to an array, plot and calculate
arr <- func_2_arr(func = para, X = seq(-1.5, 1.5, by = 0.01), Y = seq(-1.5, 1.5, by = 0.01))
plot2D.arr(arr = arr)
##define the mask and then plot it as a matrix
M <- arr[,,2]^2 + arr[,,3]^2 <= 1
image(M, asp=1.0)
##mask matrix M1 and plot
M1 <- mat.mask(org = arr[,,1], mask = M, drop.dat = T)
image(M1, asp=1.0)
##size matrix M2 and plot
M2 <- mat.size(org = arr[,,1], mask = M)
image(M2, asp=1.0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.