Dot multiplication (matrices or hypermatrices)
C = CL_dMult(A,B)
Multiplies matrices (or hypermatrices) elementswise (extends ".*").
The matrices (or hypermatrices) are first expanded so that if the size in one dimension is 1, the values are duplicated to match the maximum size between the 2 matrices (or hypermatrices) in that dimension.
If A or B is [], the result is [].
Notes:
- The function works for matrices or hypermatrices of any size.
Matrix or hypermatrix (NxPx... or 1xPx... or Nx1x... etc...)
Matrix or hypermatrix (NxPx... or 1xPx... or Nx1x... etc...)
Result (NxPx...)
CNES - DCT/SB
M = [1, 2, 3; 4, 5, 6; 7, 8, 9]; f = [1; 2; 3]; // Multiply rows of M by factors in f CL_dMult(f, M) // => same as [f(1)*M(1,:); f(2)*M(2,:); f(3)*M(3,:)] // Multiply columns of M by factors in f CL_dMult(f', M) // => same as [f(1)*M(:,1), f(2)*M(:,2), f(3)*M(:,3)] // Other cases with matrices or vectors CL_dMult(M, f) // => same as CL_dMult(f, M) CL_dMult(f, f') // => same as f * f' CL_dMult(f', f) // => same as CL_dMult(f, f') // Other cases with hypermatrices CL_dMult(f, ones(3,2,4)) // => same as repmat(f, [1,2,4]) CL_dMult(M, ones(3,3,4)) // => same as repmat(M, [1,1,4]) |