/* make_gnuplotdata.c sin(x)+cos(y) test data to file */ #include #include #include int main(int argc, char *argv[]) /* give output file name */ { int nx=40; int ny=40; double xmin=0.0; double xmax=12.56; double ymin=0.0; double ymax=12.56; double x,y,z,dx,dy; int i,j; FILE * outp; if(argc>1) { outp=fopen(argv[1], "w"); if(outp==NULL) { printf("can not open %s for writing \n", argv[1]); return 1; } } else { printf("provide file name to write. \n"); return 0; } dx = (xmax-xmin)/(double)(nx-1); dy = (ymax-ymin)/(double)(ny-1); for(i=0; i