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
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. | ![]() | ![]() |