User manual
653
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
Matrix_Add
Prototype
procedure Matrix_Add(var src1, src2, dest: array[1024] of word; numRows,
numCols: word);
Description Function does matrix addition.
dstM[i][j] = srcM1[i][j] + srcM2[i][j]
Parameters - src1: rst matrix
- src2: second matrix
- dest: result matrix
- numRows1: number of rows in the rst matrix
- numCols2: number of columns in the second matrix
Returns Nothing.
Requires Nothing.
Example
var
mx1 : array[6] of word;
mx2 : array[6] of word;
mx3 : array[6] of word;
...
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