File Exchange

image thumbnail

Tutorial: C mex matrix demo

version (134 KB) by Nick Clark
Index matrix in C like you would do in MATLAB!


Updated 21 Dec 2007

View License

This short tutorial illustrates basic numerical matrix computation in C. I encourage any comments from expirienced mex programmers for style improvement.

This is a nice little function to demonstrate how you can interface MATLAB and C style matricies. There is some example code included showing how you can index your C matricies like you can in MATLAB and how you can use a little function to pass data between them. The actual function is trivial, but illustrates different methods of handling multi-dimensional data using pointers.

This latest version includes updates and copies emails regarding different methods from James Tursa.

Cite As

Nick Clark (2019). Tutorial: C mex matrix demo (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Jeong Kim

The tutorial helped a lot.




* New files added
* PDF instructions and email contributions from other authors added.

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux