Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Creating Mex-files from MATLAB code

Subject: Creating Mex-files from MATLAB code

From: Liana

Date: 31 Oct, 2011 18:51:12

Message: 1 of 3

Could someone please give a link to a good tutorial explaining how MEX-files can be created from Matlab code? P.S. I have a function 'myfun.m' that calls 4 functions 'myfun1.m'-'myfun4.m'

Thanks.

Subject: Creating Mex-files from MATLAB code

From: James Tursa

Date: 31 Oct, 2011 23:34:10

Message: 2 of 3

"Liana" wrote in message <j8mqmv$98v$1@newscl01ah.mathworks.com>...
> Could someone please give a link to a good tutorial explaining how MEX-files can be created from Matlab code? P.S. I have a function 'myfun.m' that calls 4 functions 'myfun1.m'-'myfun4.m'
>
> Thanks.

1) Why do you want to create a mex file from your m-files?

2) Do you want MATLAB to create the mex file ala emlmex? Or are you talking about converting the whole thing to C code?

James Tursa

Subject: Creating Mex-files from MATLAB code

From: Liana

Date: 31 Oct, 2011 23:46:26

Message: 3 of 3

Well, I'm just trying to speed up my code. But I don't need a C++ or C shared library, because they operate more slowly due to calling Matlab built-in functions through DLL.
Finally I came to the conclusion that my code cannot be compiled into MEX-file, because 'codegen funname.m' says that some of my important sub-functions are not supported for standalone code generation. Is it correct?

"James Tursa" wrote in message <j8nb9i$38a$1@newscl01ah.mathworks.com>...
> "Liana" wrote in message <j8mqmv$98v$1@newscl01ah.mathworks.com>...
> > Could someone please give a link to a good tutorial explaining how MEX-files can be created from Matlab code? P.S. I have a function 'myfun.m' that calls 4 functions 'myfun1.m'-'myfun4.m'
> >
> > Thanks.
>
> 1) Why do you want to create a mex file from your m-files?
>
> 2) Do you want MATLAB to create the mex file ala emlmex? Or are you talking about converting the whole thing to C code?
>
> James Tursa

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us