#!/bin/csh -f

set version = "V1.02/September 7, 2001"

# September 7 2001, V1.02.  Change so can be built using standard build
#`	scripts.   rcg
#Edited August 5, 2001.  Change to use new environment variables.
#	Add version number.  Based on matplot routine.  rcg
#Edited July 22, 1998.  Add to make sendit executable.  rcg

#echo "Content-type: text/html"
#echo ""

#echo "In routine matplotxy version=$version"

source build-opt-env

set tmpdir = ${USETEMPDIR}

setenv HD ${OPTHOME}/optbin

cd $tmpdir

#echo "<p>"
#ls 
#echo "<p>"

#pwd

set tmp=$PATH_INFO
#setenv OBJ $tmp:r

#unsetenv PATH_INFO

#if ( "$QUERY_STRING" != "" ) then
#  setenv OBJ "$OBJ($QUERY_STRING)"
#endif
setenv OBJ $OBJECT

setenv TMP `date '+%H%M%S'`
rm *.ppm *.gif *.ps

$HD/matedit  "${HD}/" > doit.m
/usr/local/bin/matlab -nosplash < doit.m >> /dev/null

#Note: For version 6 of Matlab use
#	/usr/local/bin/matlab -nojvm -nosplash -r doit.m
chmod +x ./sendit
./sendit

