<< matdiv Basic functions meanc >>

Grocer >> Basic functions > matmul

matmul

matrix elementwise multiplication

CALLING SEQUENCE

[out]=matmul(x,y)

PARAMETERS

Input

* x,y = two matrices (not of the same dimension but are row or column compatible)

 

Output

* out = x.*y where x and y are row or column compatible

DESCRIPTION

Performs matrix multiplication even if matrices are not of the same dimension, but are row or column compatible

EXAMPLE

x1=ones(7,1);x2=[1:7]';y = lag([x1 x2],1,4);z=0.5*ones(7,1);matmul(x,z)
// returns:
//!   2.     2.  !
//!    .5     .5 !
//!    .5    1.  !
//!    .5    1.5 !
//!    .5    2.  !
//!    .5    2.5 !
//!    .5    3.  !
 
xstar = matmul(x,sqrt(w));
// Example taken from function robust: makes the term by term multiplication of each column of matrix x ((nxk) matrix of exogenous variables) by the (nx1) vector of weights for the ongoing weighted least squares estimation.

AUTHOR

Eric Dubois 2002

Report an issue
<< matdiv Basic functions meanc >>