matmul — matrix elementwise multiplication
[out]=matmul(x,y)
x,y = two matrices (not of the same dimension but are row or column compatible)
out = x.*y where x and y are row or column compatible
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.