Clear Filters
Clear Filters

How to run matlab executable c code file?

4 views (last 30 days)
Nikhil
Nikhil on 23 Jun 2014
Edited: James Tursa on 24 Jun 2014
Hello all,
I am trying to load one .c code file in Matlab. The file is Matlab executable. but when I try to load file with following code,
mex stress_SVD_1_matlab.c
I am getting following error:
Specified export _mexFunction is not defined Missing exports. Aborting
C:\PROGRA~2\MATLAB\R2013A\BIN\MEX.PL: Error: Link of 'stress_SVD_1_matlab.mexw32' failed.
Error using mex (line 206)
Unable to complete successfully.
I have attached .pdf version of my file here. Can somebody please guide me how to successfully load this file in Matlab?
Thanks you in advance,
Nikhil

Answers (1)

James Tursa
James Tursa on 24 Jun 2014
Edited: James Tursa on 24 Jun 2014
Not sure if it will make a difference, but try changing these lines:
#include <matrix.h>
#include <mex.h>
to this:
#include "mex.h"
Also, I don't see the initialization( ) or evaluate( ) function bodies in the source code. Is what you posted really what you mex'ed? I would have expected more errors.
EDIT
Nevermind, I just saw that your entire source code is commented out! So you are compiling a completely empty file as far as non-comment source code is concerned, and thus there is no mexFunction.
Change this:
/*
#include <matrix.h>
#include <mex.h>
:
}
*/
to this:
#include "mex.h"
:
}
Then you will also have to deal with the initialization( ) and evaluate( ) funcion bodies as pointed out above.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!