#include "mex.h" #include "math.h" #include "EigenDecomposition3.c" void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { float *Dxx, *Dxy, *Dxz, *Dyy, *Dyz, *Dzz; float *Deiga, *Deigb, *Deigc; float *Dvecxa, *Dvecya, *Dvecza; float *Dvecxb, *Dvecyb, *Dveczb; float *Dvecxc, *Dvecyc, *Dveczc; mwSize output_dims[2]={1, 3}; double Ma[3][3]; double Davec[3][3]; double Daeig[3]; /* Loop variable */ int i; /* Size of input */ const mwSize *idims; int nsubs=0; /* Number of pixels */ int npixels=1; /* Check for proper number of arguments. */ if(nrhs!=6) { mexErrMsgTxt("Six inputs are required."); } else if(nlhs!=12) { mexErrMsgTxt("Twelve outputs are required"); } for(i=0; i<6; i++) { if(!mxIsSingle(prhs[i])){ mexErrMsgTxt("Inputs must be single"); } } /* Get the number of dimensions */ nsubs = mxGetNumberOfDimensions(prhs[0]); /* Get the sizes of the inputs */ idims = mxGetDimensions(prhs[0]); for (i=0; i