Thank you. This solved the type thing. Unfortunately, the #2114 warning still keeps popping up. The full source now is:
#include <uchar.h>
#include <math.h>
#include <complex.h>
#include "mex.h"
void mexFunction( int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[] )
/* function W = mandelbrot(iter, points, center, width);
* Complex arithmetic:
* z = z.^2 + z0
*/
{
double *xr,*xi,*W;
int np, width, iter, jj, ii, kk;
complex double C0, z;
double dz;
iter = ( int) mxGetScalar(prhs[0]);
np =( int) mxGetScalar(prhs[1]);
width = mxGetScalar(prhs[2]);
plhs[0] = mxCreateDoubleMatrix(np, np, mxREAL);
W = mxGetPr(plhs[0]);
dz= width / ((double) np - 1);
for (jj=0; jj<np; jj++) {
for (ii=0; ii<np; ii++) {
z=0;
/* current point in complex plane*/
C0 = -width/2 + dz*jj + I*(-width/2 + dz*ii);
/* iteration*/
for (kk=0; kk<iter; kk++) {
z = z*z + C0;
/* measure divergence speed*/
W[ii + jj*np] += (cabs(z)>=2);
}
}
}
return ;
}