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

New to MATLAB?

Thread Subject:
Codegen mex file slower than normal matlab?

Subject: Codegen mex file slower than normal matlab?

From: Chuck37

Date: 27 Sep, 2012 16:03:08

Message: 1 of 1

I've seen this before when certain functions are used that matlab is natively good at, but this one seemed like a slam dunk. I have a script that has to do many, many RSS computations of two variables:

out = sqrt(in1^2 + in2^2)

I had a little function to do this and I converted it to mex using the matlab coder. The result was that the mex version took almost exactly twice as long (to do 1 million RSSs using tic/toc).

Why would this be? Is there overhead getting into mex or something?

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