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:
Can i profile Embedded Matlab file?

Subject: Can i profile Embedded Matlab file?

From: Louis

Date: 6 Apr, 2011 19:07:05

Message: 1 of 2

Hello Folks,

I have two questions, and I really appreciate your feedback for the following scenario:

I am using Embedded Matlab to MEX my .m files. So I made my .m files to be compatible with Embedded Matlab.
So let’s assume one of the compatible .m file is “Embed_file.m “ and I use
>> emlmex Embed_file.m –o Embed_Mex_file
to get the “Embed_Mex_file.mex32” for the .m function but with different names so I don’t get name conflict, and I can use both functions (.m and mex32).

By just embedding the code without any optimization, the “Embed_Mex_file.mex” is 5 times faster than “Embed_file.m”.
My questions are:
1- How can I profile this “Embed_Mex_file” to optimize the speed? What I am currently doing is profiling “Embed_file.m”, and I think that’s not the right way because I am killing some bottlenecks in the .m file but no significant improvement is obtained in the generated .mex file.

2-I have a .c file for the Embed_file.m that was written in C and then was Mex’ed to run on Matlab. This file is approximately 4-5 times faster than my generated Embed_Mex_file in step 1. So should I conclude that optimized .c mex’ed will “always” be faster than optimized .m mex’ed ? and that I won’t be able to optimize my .mex file to reach the .c mex’ed file?

Thank you,


Subject: Can i profile Embedded Matlab file?

From: Louis

Date: 11 Apr, 2011 11:32:04

Message: 2 of 2

Sorry for reposting it, but i couldn't find an answer yet. Your feedback is appreciated.


Tags for 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