comparison examples/mystring.c @ 9932:6cb30a539481

untabify files in examples directory
author John W. Eaton <jwe@octave.org>
date Mon, 07 Dec 2009 14:53:20 -0500
parents 4295d634797d
children be41c30bcb44
comparison
equal deleted inserted replaced
9931:fb6b6fcafa62 9932:6cb30a539481
1 #include <string.h> 1 #include <string.h>
2 #include "mex.h" 2 #include "mex.h"
3 3
4 void 4 void
5 mexFunction (int nlhs, mxArray *plhs[], int nrhs, 5 mexFunction (int nlhs, mxArray *plhs[], int nrhs,
6 const mxArray *prhs[]) 6 const mxArray *prhs[])
7 { 7 {
8 mwIndex i, j; 8 mwIndex i, j;
9 mwSize m, n; 9 mwSize m, n;
10 mxChar *pi, *po; 10 mxChar *pi, *po;
11 11
15 15
16 m = mxGetM (prhs[0]); 16 m = mxGetM (prhs[0]);
17 n = mxGetN (prhs[0]); 17 n = mxGetN (prhs[0]);
18 pi = mxGetChars (prhs[0]); 18 pi = mxGetChars (prhs[0]);
19 plhs[0] = mxCreateNumericMatrix (m, n, mxCHAR_CLASS, 19 plhs[0] = mxCreateNumericMatrix (m, n, mxCHAR_CLASS,
20 mxREAL); 20 mxREAL);
21 po = mxGetChars (plhs[0]); 21 po = mxGetChars (plhs[0]);
22 22
23 for (j = 0; j < n; j++) 23 for (j = 0; j < n; j++)
24 for (i = 0; i < m; i++) 24 for (i = 0; i < m; i++)
25 po [j*m + m - 1 - i] = pi [j*m + i]; 25 po [j*m + m - 1 - i] = pi [j*m + i];