How to run matlab executable c code file?

4 次查看(过去 30 天)
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

回答(1 个)

James Tursa
James Tursa 2014-6-24
编辑:James Tursa 2014-6-24
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.

类别

Help CenterFile Exchange 中查找有关 MATLAB Compiler 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by