Main Page   Compound List   File List   Compound Members   File Members  

test2.c

Go to the documentation of this file.
00001 
00028 #include <string.h>
00029 #include <stdio.h>
00030 #include <fitsio.h>
00031 #include <malloc.h>
00032 
00033 #include "mex.h"
00034 #include "matrix.h"
00035 
00046 void
00047 mexFunction (int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[])
00048 {
00049   double *data = 0;
00050   mxArray *array = 0;
00051   char *hello = "hello";
00052   char *hello2 = 0;
00053   hello2= malloc(sizeof(char)*6);
00055   strcpy(hello2, hello);
00056   printf("%s %e\n", hello2, (double)(unsigned int)hello2);
00057   array = mxCreateNumericMatrix(1, 1, mxUINT32_CLASS, mxREAL);
00058   data = mxGetData(array);
00059   *data = (double)((unsigned int)hello2);
00060   plhs[0] = array;
00061   return;
00062 }


Operated by University of California for the National Nuclear Security Administration of the US Department of Energy. Copyright © 2002-2003 UC | Disclaimer/Privacy
This website has been approved for unlimited release with associated LA-UR number LA-UR-03-0949.