#include <mlab_myeval.ci>
#include <client.h>

/* This needs to be run twice to have foo.m in the right directory. */

int main (int argc, char **argv)
{
	const char *loc = "mlab_myeval.exe";
	ctl::link lnk(loc);
	try
	{
		myVector xs(5);
		for (int i=0;i<xs.size();i++)
			xs[i] = i+1;
		std::string funid("foo");

		Matlab::use(lnk);
		unlink("eval-out.eps");
		Matlab::myeval<void, myVector, std::string>(xs, funid);
		sleep(4);
		int foo = access("eval-out.eps", R_OK);
		std::cout << foo << "\n";
	}
	catch (ctl::exception &e)
	{
		std::cerr << e << "\n";
	}
	return 0;
}
