using MEX file and constants

1 visualización (últimos 30 días)
michael
michael el 27 de Sept. de 2013
Editada: James Tursa el 27 de Sept. de 2013
Hello,
I need to use PI value inside the mex file. how should i do it? (because right now I'm getting an error): Error GMSK_viterbi.c: 66 undeclared identifier `PI'

Respuesta aceptada

James Tursa
James Tursa el 27 de Sept. de 2013
Editada: James Tursa el 27 de Sept. de 2013
One way:
#include <math.h>
Then use M_PI for the value in your code instead of PI, or you could add this line also:
#define PI M_PI
Another way:
#define PI 3.1415926535897932
One could also use compile option -D to get it defined.

Más respuestas (0)

Categorías

Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by