Mercurial > octave-libgccjit
view examples/mystring.c @ 18956:ab5983dc0587 stable
statistics.m: Fix regression caused by change in skewness, kurtosis functions.
* statistics.m: Call skewness and kurtosis functions with an empty matrix
(use default) for the flag argument. Add %!test to check correct behavior.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 24 Jul 2014 11:11:57 -0700 |
parents | 224e76250443 |
children |
line wrap: on
line source
#include <string.h> #include "mex.h" void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { mwSize m, n; mwIndex i, j; mxChar *pi, *po; if (nrhs != 1 || ! mxIsChar (prhs[0]) || mxGetNumberOfDimensions (prhs[0]) > 2) mexErrMsgTxt ("ARG1 must be a char matrix"); m = mxGetM (prhs[0]); n = mxGetN (prhs[0]); pi = mxGetChars (prhs[0]); plhs[0] = mxCreateNumericMatrix (m, n, mxCHAR_CLASS, mxREAL); po = mxGetChars (plhs[0]); for (j = 0; j < n; j++) for (i = 0; i < m; i++) po[j*m + m - 1 - i] = pi[j*m + i]; }