<< Math Math CL_adjustState >>

celestlab >> Math > CL_addm

CL_addm

Addition of 2 matrices

Calling Sequence

C = CL_addm(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

// Example 1
A = [1, 2, 3];
B = [4; 5; 6];

// A + B
CL_addm(A, B) // => same as repmat(A, 3, 1) + repmat(B, 1, 3)

// A - B
CL_addm(A, -B) // => same as repmat(A, 3, 1) - repmat(B, 1, 3)

// Example 2
u = [1; 0; 0];
v = [[1;0;0], [0;1;0], [0;0;1]];

// u - v
CL_addm(u, -v)

Report an issue
<< Math Math CL_adjustState >>