OpenStax CNX

Sections
You are here: Home » Content » Writing C Functions in MATLAB (MEX-Files)

About: Writing C Functions in MATLAB (MEX-Files)

Module by: Jason Laska. E-mail the author

View the content: Writing C Functions in MATLAB (MEX-Files)

Metadata

Name: Writing C Functions in MATLAB (MEX-Files)
ID: m12348
Language: English (en)
Summary: This is a basic guide to writing mex files for MATLAB in C. This guide gives a simple background of some the MATLAB mex features so that learning to write mex files can be quick and easy.
Subject: Science and Technology
Keywords: c functions, c language, fast functions in matlab, matlab, mex
Document Type: -//CNX//DTD CNXML 0.5 plus MathML//EN
License: Creative Commons Attribution License CC-BY 1.0

Authors: Jason Laska (laska@rice.edu)
Copyright Holders: Jason Laska (laska@rice.edu)
Maintainers: Jason Laska (laska@rice.edu), Robert Morrison (rlmorris@uiuc.edu), Douglas L. Jones (dl-jones@uiuc.edu)

Latest version: 1.2 (history)
First publication date: Jul 17, 2004 6:17 pm +0000
Last revision to module: Aug 1, 2004 5:46 pm +0000

Downloads

PDF: m12348_1.2.pdf PDF file, for viewing content offline and printing. Learn more.
XML: m12348_1.2.cnxml XML that defines the structure and contents of the module, minus any included media files. Can be reimported in the editing interface. Learn more.

Version History

Version: 1.2 Aug 1, 2004 5:46 pm +0000 by Jason Laska
Changes:
Fixed Some Typos

Version: 1.1 Aug 1, 2004 5:00 pm +0000 by Jason Laska
Changes:
First Version
-Shows the purpose of a mex-function
-Step through of how a Mex-File is organized
-How to use some basic functions from the mex.h library
-List of other useful functions

How to Reuse and Attribute This Content

If you derive a copy of this content using a OpenStax-CNX account and publish your version, proper attribution of the original work will be automatically done for you.

If you reuse this work elsewhere, in order to comply with the attribution requirements of the license (CC-BY 1.0), you must include

  • the authors' names: Jason Laska
  • the title of the work: Writing C Functions in MATLAB (MEX-Files)
  • the OpenStax-CNX URL where the work can be found: http://cnx.org/content/m12348/1.2/

See the citation section below for examples you can copy.

How to Cite and Attribute This Content

The following citation styles comply with the attribution requirements for the license (CC-BY 1.0) of this work:

American Chemical Society (ACS) Style Guide:

Laska, J. Writing C Functions in MATLAB (MEX-Files), OpenStax-CNX Web site. http://cnx.org/content/m12348/1.2/, Aug 1, 2004.

American Medical Assocation (AMA) Manual of Style:

Laska J. Writing C Functions in MATLAB (MEX-Files) [OpenStax-CNX Web site]. August 1, 2004. Available at: http://cnx.org/content/m12348/1.2/.

American Psychological Assocation (APA) Publication Manual:

Laska, J. (2004, August 1). Writing C Functions in MATLAB (MEX-Files). Retrieved from the OpenStax-CNX Web site: http://cnx.org/content/m12348/1.2/

Chicago Manual of Style (Bibliography):

Laska, Jason. "Writing C Functions in MATLAB (MEX-Files)." OpenStax-CNX. August 1, 2004. http://cnx.org/content/m12348/1.2/.

Chicago Manual of Style (Note):

Jason Laska, "Writing C Functions in MATLAB (MEX-Files)," OpenStax-CNX, August 1, 2004, http://cnx.org/content/m12348/1.2/.

Chicago Manual of Style (Reference, in Author-Date style):

Laska, J. 2004. Writing C Functions in MATLAB (MEX-Files). OpenStax-CNX, August 1, 2004. http://cnx.org/content/m12348/1.2/.

Modern Languages Association (MLA) Style Manual:

Laska, Jason. Writing C Functions in MATLAB (MEX-Files). OpenStax-CNX. 1 Aug. 2004 <http://cnx.org/content/m12348/1.2/>.