bsxfun: Broadcasting an operation on multi-dimensinoal arrays

Description Usage Arguments Value Note Author(s) Examples

Description

Broadcasting two arrays to the same shape and then apply FUN.

Usage

1
bsxfun(arrA, arrB, FUN = "+", ...)

Arguments

arrA, arrB

Arrays to perfom the operator FUN(arrA,arrB)

FUN

function to be performed (must be vectorised)

Value

An array of the shape with each dimension being the maximum of dimA,dimB.

Note

# Fri Feb 9 14:41:25 2018 ——————————

Author(s)

Feng Geng (shouldsee.gem@gmail.com)

Examples

1
2
3
  M = array(1:12,dim=c(2,2,3))
  N = rbind(c(1,2))
  O = bsxfun(M,N,'*')

shouldsee/Rutil documentation built on May 27, 2019, 1:09 p.m.