Rev | Line | |
---|
[2994] | 1 | /*\file Test.c
|
---|
| 2 | *\brief: test module. do whatever you want in here
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #include "./Test.h"
|
---|
| 6 |
|
---|
| 7 | void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
|
---|
| 8 |
|
---|
| 9 | /*diverse: */
|
---|
| 10 | int noerr=1;
|
---|
| 11 |
|
---|
| 12 | /*Boot module: */
|
---|
| 13 | MODULEBOOT();
|
---|
| 14 |
|
---|
| 15 | /*checks on arguments on the matlab side: */
|
---|
| 16 | CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&TestUsage);
|
---|
| 17 |
|
---|
| 18 | double* pr=mxGetPr(prhs[0]);
|
---|
| 19 | int M=mxGetM(prhs[0]);
|
---|
| 20 | int N=mxGetM(prhs[0]);
|
---|
| 21 | mwIndex* ir=mxGetIr(prhs[0]);
|
---|
| 22 | mwIndex* jc=mxGetJc(prhs[0]);
|
---|
| 23 | int nzmax=(int)mxGetNzmax(prhs[0]);
|
---|
| 24 |
|
---|
| 25 | int i;
|
---|
| 26 | printf("nzmax %i\n",nzmax);
|
---|
| 27 | printf("jc:\n");
|
---|
| 28 | for(i=0;i<N+1;i++){
|
---|
| 29 | printf("%i\n",jc[i]);
|
---|
| 30 | }
|
---|
| 31 | printf("ir vale:\n");
|
---|
| 32 | for(i=0;i<nzmax;i++){
|
---|
| 33 | printf("%i %g\n",ir[i],pr[i]);
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | /*end module: */
|
---|
| 38 | MODULEEND();
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | void TestUsage(void)
|
---|
| 42 | {
|
---|
| 43 | _printf_("\n");
|
---|
| 44 | _printf_(" usage: %s(whatever in here);\n",__FUNCT__);
|
---|
| 45 | _printf_("\n");
|
---|
| 46 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.