<< CL_cross Math CL_detectSign >>

CelestLab >> Math > CL_dMult

CL_dMult

Dot multiplication (matrices or hypermatrices)

Calling Sequence

C = CL_dMult(A,B)

Description

Parameters

A:

Matrix or hypermatrix (NxPx... or 1xPx... or Nx1x... etc...)

B:

Matrix or hypermatrix (NxPx... or 1xPx... or Nx1x... etc...)

C:

Result (NxPx...)

Authors

See also

Examples

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])

Report an issue
<< CL_cross Math CL_detectSign >>