Name

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


1) x1=ones(7,1);x2=[1:7]';y = lag([x1 x2],1,4);z=0.5*ones(7,1);matmul(x,z)

2) xstar = matmul(x,sqrt(w));

 

Example 1 gives the matrix: 

!   2.     2.  !

!    .5     .5 !

!    .5    1.  !

!    .5    1.5 !

!    .5    2.  !

!    .5    2.5 !

!    .5    3.  !

 

Example 2 (taken from 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