mex_files_guide - Page 1 of 17 1605 Revison: 1.0 MEX-files...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1605 MEX-files Guide Revison: 1.0 Last Date Modified: 04-August-2003 Introduction 1. Introduction to MEX - files 2. Getting help Compiling MEX-files 3. System setup and configuration 4. Testing your system with example MEX - files 5. Troubleshooting system configuration problems 6. Compiling MEX - files with the Microsoft Visual C++ IDE 7. Setting up the MATLAB Add - In for Visual Studio MEX-file components 8. The ingredients of a MEX - file 9. mex.h 10. mexFunction gateway 11. The mxArray 12. API functions MEX-file examples 13. Writing a "Hello World" MEX - file 14. Using API routines to work with mxArrays 15. Checking inputs and outputs via a MEX - file 16. Passing arrays between MEX - files and MATLAB 17. Calling MATLAB functions from MEX - files 18. Additional MEX examples Advanced MEX options 19. Custom options files 20. Linking multiple files Debugging MEX-files 21. General debugging steps 22. Debugging with the Microsoft Developer's Studio 23. Debugging with DBX in UNIX 24. Using other debuggers C++ MEX-files 25. WARNING 26. Tips for C++ MEX - files 27. Compiling C++ MEX - files Troubleshooting MEX problems Page 1 of 17 3/4/2004
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
28. If linking fails 29. If loading fails 30. If running fails - segmentation violations Section 1: Introduction MEX-files This technical note provides a general overview of MEX-files and a detailed explanation of the external interface functio interface C or Fortran subroutines to MATLAB. MEX-files are a way to call your custom C or FORTRAN routines direct they were MATLAB built-in functions. MEX stands for MATLAB Executable. MEX-files are dynamically linked subroutines produced from C or Fortran source compiled, can be run from within MATLAB in the same way as MATLAB M-files or built-in functions. The external interf functionality to transfer data between MEX-files and MATLAB, and the ability to call MATLAB functions from C or Fortra The main reasons to write a MEX-file are: 1. The ability to call large existing C or FORTRAN routines directly from MATLAB without having to rewrite t 2. Speed; you can rewrite bottleneck computations (like for-loops) as a MEX-file for efficiency. MEX-files are not appropriate for all applications. MATLAB is a high-productivity system whos specialty is eliminating ti level programming in compiled languages like C or Fortran. In general, most programming should be done in MATLAB facility unless your application requires it. Section 2: Getting help You can learn more about MEX-files from the MATLAB External Interfaces Guide . If you already know how to write a M use the External Interfaces Function Reference . NOTE: The MathWorks Technical Support department does not have the resources needed to develop custom code fo application. If, however, a function is not behaving as you think it should, you can contact Technical Support for help. Section 3: System setup and configuration
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 17

mex_files_guide - Page 1 of 17 1605 Revison: 1.0 MEX-files...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online