demo mex file based on gnumex example