User`s guide

6 Standalone Applications
/* Initialize with a print handler to tell mlfPrintMatrix
* how to display its output.
*/
mclInitializeApplication(NULL,0);
libMultpkgInitializeWithHandlers( PrintHandler,PrintHandler);
/* Create input matrix "x" */
x = mxCreateDoubleMatrix(ROWS , COLS, mxCOMPL EX);
memcpy(mxGetPr(x), x_ pr, ROWS * COLS * sizeof(double));
memcpy(mxGetPi(x), x_ pi, ROWS * COLS * sizeof(double));
/* Create input matrix "y" */
y = mxCreateDoubleMatrix(ROWS , COLS, mxCOMPL EX);
memcpy(mxGetPr(y), y_ pr, ROWS * COLS * sizeof(double));
memcpy(mxGetPi(y), y_ pi, ROWS * COLS * sizeof(double));
/* Call the mlfMultarg function. */
mlfMultarg(2, &a, &b, x, y);
/* Display the entire contents of output matrix "a". */
mlfPrintmatrix(a);
/* Display the entire contents of output scalar "b" */
mlfPrintmatrix(b);
/* Deallocate temporary matrices. */
mxDestroyArray(a);
mxDestroyArray(b);
libMultpkgTerminate();
mclTerminateApplication();
return(0);
}
You can build this program into a standalone a pplication by entering this
command on a single line:
mcc -W lib:libMultpkg -T link:exe multarg printmatri x
multargp.c main_for_li b.c
6-20