The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to re-build mex from files generated from coder?
Replies: 4   Last Post: Mar 24, 2013 12:51 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Sida Zhou

Posts: 14
Registered: 5/16/12
Re: How to re-build mex from files generated from coder?
Posted: Mar 22, 2013 8:47 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> You said that in order to create mex file from your testfunc_mex.c, you needed to run testfunc_mex.bat. I didn't understand this part. Do you run it outside matlab prior to mex command? Could you, please, elaborate on that? Sorry if my question may seem naive.
> Thank you
> Valery

Hi Valery

Usually when we create .mex files, we are told that we should write C code (.c file) and then in matlab command window, we would use the command "mex filename.c", this will produce .mex file.

However, the .c files created by the coder doesn't behave like this. As I wrote above, if I try "mex testfunc_mex.c", then it will yield error and doesnt produce .mex file.

In order to produce .mex file from .c files generated from coder. We must find and run testfunc_mex.bat (alsop generated by the coder), under windows. This .bat is bit of a magical black box to me, and it will create .mex file. (after using coder, there is already a .mex file created, to test this testfunc_mex.bat works, you can delete the original .mex file, and you'll see, after you run testfunc_mex.bat, a new .mex file is generated somewhere inside the folder). (This also mean, you will never need to run "mex" function inside matlab at any point)


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.