/***************************************************************** MATSCAN.C This is a function for summarizing the contents of a matfile. There is also a main() function calling matscan(), for making a dos command to summarize the contents of the matfile named on the command line. Eric Firing 88-02-12 ******************************************************************/ #include "common.h" /* free(), exit() */ #include "matfile.h" void matscan(FILE *fp) { char type; /* type of matrix */ char pname[40]; /* matrix name */ int mrows; /* row dimension */ int ncols; /* column dimension */ int imagf; /* imaginary flag */ char *preal, /* pointer to real data */ *pimag; /* pointer to imag data */ int i, j; putchar('\n'); while(!loadmat(fp, &type, pname, &mrows, &ncols, &imagf, &preal, &pimag)) { printf("type: %c, name: %15s, rows: %3d, cols: %3d, complex?: %c\n", type, pname, mrows, ncols, (imagf ? 'y' : 'n')); if (type == 't') { printf(" Text is: "); for(i=0;i