Skip to content

Instantly share code, notes, and snippets.

@rej55
Last active December 3, 2017 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rej55/cdf1cf5f624435355099a612c85bb89e to your computer and use it in GitHub Desktop.
Save rej55/cdf1cf5f624435355099a612c85bb89e to your computer and use it in GitHub Desktop.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
double* ptr;
ptr = mxCalloc(5*5, sizeof(double));
/* ここでptrに数値データを入れていく */
plhs[0] = mxCreateDoubleMatrix(5, 5, mxREAL);
mxSetPr(plhs[0], ptr);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment