needed help for mex with 3D output matrix
Show older comments
It is the code for mex I am trying to generate.. it generates mex file successfully but matlab crashes out.. can someone spot the error?
#include "mex.h"
double IDWT(double x[10][64], double Dct_matrix[10][10], double IW[8][8], double out[10][8][8])
{
operations are performed on matrices
double out[10][8][8] is the output matrix
}
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
double **inMatrix;
double **inMatrix1;
double **inMatrix2;
double ***outMatrix;
inMatrix = mxGetPr(prhs[0]);
inMatrix1 = mxGetPr(prhs[1]);
inMatrix2 = mxGetPr(prhs[2]);
plhs[0] = mxCreateNumericArray(3,8,8,10,mxDOUBLE_CLASS,mxREAL);
outMatrix = mxGetPr(plhs[0]);
IDWT(inMatrix,inMatrix1,inMatrix2,outMatrix);
}
Accepted Answer
More Answers (0)
Categories
Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!