User manual

686
mikoC PRO for dsPIC
MikroElektronika
Matrix_Subtract
Prototype
void Matrix_Subtract(unsigned *src1, unsigned *src2, unsigned *dest, unsigned
num_rows, unsigned num_cols);
Description Function does matrix subtraction.
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
- numRows: number of rows in the source matrix
- numCols: number of cols in the source 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_Subtract(mx1, mx2, mxDest, 2, 3);
Notes - [W0..W4] used, not restored
- AccuA used, not restored
- AccuB used, not restored
- CORCON saved, used, restored
Matrix_Scale
Prototype
void Matrix_Scale(unsigned ScaleValue, unsigned *src1, unsigned *dest,
unsigned numRows, unsigned numCols);
Description Function does matrix scale.
dstM[i][j] = sclVal * srcM[i][j]
Parameters - ScaleValue: scale value
- src1: pointer to the original matrix
- dest: pointer to the result matrix
- numRows: number of rows in the source matrix
- numCols: number of cols in the source matrix
Returns Nothing.
Requires Nothing.
Example
int mx1[6] = {1,2,3,4,5,6};
int mxDest[9];
Matrix_Scale(0x4000, mx1, mxDest, 2,3);
Notes - [W0..W5] used, not restored
- AccuA used, not restored
- CORCON saved, used, restored
- numRows*numCols < 2
14