www.pudn.com > mathlib2.zip > engwindemo.c


/* engwindemo.c 
 * This is a simple program that illustrates how to call the MATLAB 
 * Engine functions from a C program for windows 
 * Copyright (c) 1996-1998 by The MathWorks, Inc. 
 * All Rights Reserved.*/ 
#include < windows.h > 
#include < stdlib.h > 
#include < stdio.h > 
#include < string.h > 
#include < d:\MATLAB6p1\extern\include\engine.h > 
void main() 
{ 
	Engine *ep; 
	/* 
	* Start the MATLAB engine  
	*/ 
	if (!(ep = engOpen(NULL))) { 
		MessageBox ((HWND)NULL, (LPSTR) 
			"Can't start MATLAB engine", "", 
			MB_OK); 
		exit(-1); 
	} 
    engEvalString(ep, "contour(peaks)"); 
	engClose(ep); 
}