Hi James, Please help me with this.
i did what you said by selecting the compiler and that part went well however after i use the mex command i get the following errors:
Could you please help me?
--------------------------------------------------------------------------
simulateDSM.c(141) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
simulateDSM.c(142) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
simulateDSM.c(147) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
simulateDSM.c(155) : warning C4090: 'function' : different 'const' qualifiers
simulateDSM.c(158) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
simulateDSM.c(170) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
simulateDSM.c(178) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
simulateDSM.c(183) : warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
simulateDSM.c(363) : error C2371: 'mexFunction' : redefinition; different basic types
C:\Program Files\MATLAB\R2011a\extern\include\mex.h(145) : see declaration of 'mexFunction'
C:\PROGRA~1\MATLAB\R2011A\BIN\MEX.PL: Error: Compile of 'simulateDSM.c' failed.
-------------------------------------------------------------------------------------------------
Post by James TursaPost by Aprameya Hello,
I am using dsexample1.m from R.Schreier's delta-sigma
toolbox. It gives me the following warning message
"Please compile the mex version with "mex simulateDSM.c"
Warning: You are running the non-mex version of
simulateDSM."
What command do I use to compile? I assume I can ignore the
warning but yet get right results? I am using Version
7.1.0.183 of MATLAB
Thank you.
1) Set the default directory to the location where the
simulateDSM.c file is. This needs to be on the MATLAB path,
btw. (e.g., you can use the Current Directory pane)
Press Enter when it asks if you want MATLAB to search for
compilers, then enter the number associated with lcc, the
built-in C compiler (or you could pick any other C compiler
from the list).
Post by Aprameya mex simulateDSM.c
simulateDSM.c
simulateDSM.mexw32 (or some other system dependent suffix)
simulateDSM.m
When you call the simulateDSM function, MATLAB will pick the
simulateDSM.mexw32 instead of the simulateDSM.m if they are
both present. What is currently happening in your case is
that simulateDSM.mexw32 is not present, so it runs the
m-file. Once you compile the c source code, however, MATLAB
will be running the mex file instead since mex files take
precedence over m-files. The m-file is still used whenever
you use "lookfor" or "help simulateDSM", so don't delete the
m-file.
James Tursa