User manual

688
mikoC PRO for dsPIC
MikroElektronika
Matrix_Add
Prototype
void Matrix_Add(unsigned *src1, unsigned *src2, unsigned *dest, unsigned
numRows, unsigned numCols);
Description Function does matrix addition.
dstM[i][j] = srcM1[i][j] + srcM2[i][j]
Parameters
- src1: pointer to the rst matrix
- src2: pointer to the second matrix
- dest: pointer to the result matrix
- numRows1: number of rows in the rst matrix
- numCols2: number of columns in the second matrix
Returns Nothing.
Requires Nothing.
Example
int mx1[6] = {1,2,3,4,5,6};
int mx2[6] = {2,2,2,2,2,2};
int mxDest[9];
Matrix_Add(mx1,mx2, mxDest,2,3);
Notes
- [W0..W4] used, not restored
- AccuA used, not restored.
- CORCON saved, used, restored.
- numRows1*numCols2 < 2
14