times: Element-wise matrix multiplication

View source: R/times.R

timesR Documentation

Element-wise matrix multiplication

Description

Emulates the times() and .* operators from Matlab.

Usage

times(a, b)

Arguments

a

first factor of the multiplication

b

second factor of the multiplication

Details

This function basically handles elements of different length better than the * operator in R, at least as far as behavior from a Matlab user is expecting.

Value

matrix with dimensions equal to the larger of the two factors

Examples

times(9, 6)
x <- matrix(1:4, 2)
y <- c(10, 3)
print(x)
print(y)
times(x, y)
x * y

matlab2r documentation built on Feb. 16, 2023, 10:39 p.m.

Related to times in matlab2r...