What could be a possible reason of getting a different result from .mex file(which is converted from .m file)?

2 views (last 30 days)
I wrote a code with matlab language that involves a lot of iterations. To enhance the speed of the code, I converted the m function file to mex file and solution building process was successful. The problem is that I get the different result from mex file. What could be the possible reason of this situation? (I use version 2014a)

Answers (1)

Walter Roberson
Walter Roberson on 21 Jul 2015
Round-off errors. Even a very slightly different way of writing an expression can give notably different results.

Categories

Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!