Mikroelektronika MIKROE-442 데이터 시트

다운로드
페이지 726
654
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
Matrix_Add
Prototype
sub  procedure  Matrix_Add(dim  byref  src1,  src2,  dest  as  word[1024],  dim 
numRows, numCols as word)
Description Function does matrix addition.
dstM[i][j] = srcM1[i][j] + srcM2[i][j]            
Parameters
- src1: 
first matrix 
- src2: 
second matrix 
- dest: 
result matrix 
- numRows1: 
number of rows in the first matrix 
- numCols2: 
number of columns in the second matrix  
Returns
Nothing.
Requires
Nothing.
Example
dim
  mx1 as word[6]
  mx2 as word[6]
  mx3 as word[6]
...
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