osimlibdir = ' ''E:\simtk\2.0\sdk\lib\';
simtklibdir = ' ''E:\simtk\2.0\sdk\lib\';
include = [' -I''E:\simtk\2.0\sdk\include'''...
           ' -I''E:\simtk\2.0\sdk\include\xercesc'''...
           ' -I''E:\simtk\2.0\sdk\include\SimTK\include'''];
libs=[osimlibdir 'osimSimulation.lib'''...
      osimlibdir 'osimCommon.lib'''...
      osimlibdir 'osimActuators.lib'''...
      osimlibdir 'xerces-c_2.lib'''...
      simtklibdir 'SimTKcommon.lib'''...
      simtklibdir 'SimTKsimbody.lib'''...
      simtklibdir 'SimTKmath.lib'''...
      simtklibdir 'SimTKlapack.lib'''];
compilerFlags=[' -DWIN32'...
               ' -D_WINDOWS'...
               ' -D_CRT_SECURE_NO_DEPRECATE'];
mexcode=' osim.cpp';
eval(['mex' mexcode libs include compilerFlags])
