June 21, 1999 Ver 1.0
Author:M.Ozawa
Matrix function calling sequence
int GetMatSizeN( int mat, int *m, int *n );
function
- parameter
- mat Matrix no(1:MatA / 2:MatB / ... / 26:MatZ / 0:MatAns )
- *m Row size(1~) (if return value is exept "NORM" then Row&Columun size is 0)
- *n Columun size(1~)(if return value is exept "NORM" then Row&Columun size is 0)
return value
sample program
#include <stdio.h>
#include "apstat.h"
void main( void )
{
if ( (err=GetMatSize(2,&m,&n)) != NORM )
printf("Error %d\n",err);
else
printf("MAT B %d * %d\n",m,n);
}
Execution result
example data

MAT B 2 * 3
int GetMatOBCD( int mat, int m, int n, OBCD *data );
function
- parameter
- mat Matrix no(1:MatA / 2:MatB / ... / 26:MatZ / 0:MatAns )
- m Row no(1~)
- n Columun no(1~)
- *data Pointer for OBCDdata.
return value
sample program
#include <stdio.h>
#include "apstat.h"
#define FIG 9
void main( void )
{
if ( (err=GetMatOBCD(2,1,3,&bcd)) != NORM ){
printf("Error %d\n",err);
} else {
for (j=0; i<FIG; j++ )
printf("%02x",bcd.dat[i]);
}
}
Execution result
example data

10050000000000
int SetMatOBCD( int mat, int m, int n, OBCD *data );
function
- parameter
- mat Matrix no(1:MatA / 2:MatB / ... / 26:MatZ / 0:MatAns )
- m Row no(1~)
- n Columun no(1~)
- *data Pointer for OBCDdata.
return value
sample program
#include <stdio.h>
#include "apstat.h"
if ( (err=GetMatOBCD(2,1,3,&bcd)) != NORM ){
printf("Error %d\n",err);
} else {
// sign conversion
switch ( bcd.dat[0]&0xf0 ){
case 0x00 :
bcd.dat[0] = (bcd.dat[0]&0x0f) | 0x50;
break;
case 0x10 :
bcd.dat[0] = (bcd.dat[0]&0x0f) | 0x60;
break;
case 0x50 :
bcd.dat[0] &= 0x0f;
break;
case 0x60 :
bcd.dat[0] = (bcd.dat[0]&0x0f) | 0x10;
break;
}
if ( (ret=SetMatOBCD(2,1,3,&bcd)) != NORM )
printf( ERROR No%d",ret);
}
}
Execution result
example data
------>
int MakeMatN( int mat, int m, int n );
function
Make matrix Area.(Data is all 0 )
If already matrix Area exists, then this Area is cleared and new Area is made.
- parameter
- mat Matrix no(1:MatA / 2:MatB / ... / 26:MatZ / 0:MatAns )
- m Row no(1~)
- n Columun no(1~)
*data Pointer for OBCDdata.
return value
sample program
#include <stdio.h>
#include "apstat.h"
void main( void )
{
int err;
if ( (err=MakeMat(1,2,1)) != NORM )
printf("Matrix Make ERROR : Error No.%d\n",err);
}
Execution result

void DelMatN( int mat );
function
- parameter
- mat Matrix no(1:MatA / 2:MatB / ... / 26:MatZ / 0:MatAns )
return value
sample program
#include "apstat.h"
void main( void )
{
}
Execution result
-----> 