First, open CompileOsim.m, and set the directories to point to the right places. Make sure you retain the "\" at the end of the line where one originally exists. Run CompileOsim, and hopefully the .mex library will be created. To test the library, type: osim(0.01,1e-5,'box.osim') If you get an error about "module not found", make sure your OS-level path includes the directory where OpenSim's dll files are. To see the path, type !path in MATLAB. If you change it, make sure to restart MATLAB for changes to take effect. Some pointers for troubleshooting the compilation: - CompileOsim is written for windows 32bit. If your OS is different, you should probably change the compilation flags (and then you're in uncharted territory, so please email me about your experience, whether successful or not). - I think you can't use MATLAB's built-in LCC compiler. type 'mex -setup' and instruct MATLAB to use Microsoft's Visual C++'s compiler. If you don't have it on your system, install the free "express" version. - If your directory names contain spaces, maybe you might want to put down the "short" DOS-type directory name (e.g., c:\progra~1\opensi~1.0\). These names can be discovered by typing "dir /X" in the appropriate directory.