How many c mex s-functions can a mdl file support?

Started by yuemuping in Matlab DSP10 years ago 2 replies

Hi, Everyone~ Happy New Year~~~ I have a weird question. I've wrote several c mex s-functions in simulink. When I ran the mdl file with...

Hi, Everyone~ Happy New Year~~~ I have a weird question. I've wrote several c mex s-functions in simulink. When I ran the mdl file with one c mex s-function per a model, it worked pretty well. However, when I put several c mex s-functions in one mdl file and ran it, the result went mad. Does it have something to do with the configuration settings? Could anyone please tell me how ...


converting .m files to dll (.mex) files in matlab

Started by anujack_21 in Matlab DSP13 years ago 1 reply

Hi all, How do I convert .m file to .mex file (dll files or executables in matlab)? As far I understand the .mex files are...

Hi all, How do I convert .m file to .mex file (dll files or executables in matlab)? As far I understand the .mex files are written in C. But I am not very comfortable in C. Is there a ways to convert the .m file in to .mex files without writing a program in C?? Th


how to use "MEX" to compile CPP program

Started by rajeshpeddi in Matlab DSP8 years ago

Hello Friends , The steps i followed was step 1: i executed 'mex -setup' and configured Microsoft visual studio as...

Hello Friends , The steps i followed was step 1: i executed 'mex -setup' and configured Microsoft visual studio as the compiler . step 2 : then after i executed my ".cpp" program but it is giving me the follwing error , for C and CPP programs C:\MATLAB7\BIN\WIN32\MEX.PL: Error: Compile of 'hello.c' failed. ??? Error using ==> mex


MEX

Started by donomy_00 in Matlab DSP16 years ago

Hi I have compiled a C code in Matlab using the function MEX Filename.c I have got the .dll file but when I tried to use the...

Hi I have compiled a C code in Matlab using the function MEX Filename.c I have got the .dll file but when I tried to use the function, it gave an error message - "Invalid MEX-file". Can anyone please help me? Thank you very much. Chee


Mex-file generation from C code

Started by Joel Ilao in Matlab DSP16 years ago 2 replies

Hi! I would like to know how to create mex-files from C code. I have tried to compile one using MinGW but is unsuccessful in...

Hi! I would like to know how to create mex-files from C code. I have tried to compile one using MinGW but is unsuccessful in doing so. Can someone help me with this, or suggest a simpler method of compiling c code into mex-file? Can somebody suggest a site illustra


MEX Compiler and comments in C

Started by Sergio Dominguez in Matlab DSP15 years ago

Hi all! I am having problems compiling a c mex file with the lines that have comments of the type // comment If they...

Hi all! I am having problems compiling a c mex file with the lines that have comments of the type // comment If they are written like /*comment*/ everyting goes OK. I am using gcc as compiler for mex, and compiling in Window


Urgent problem about Mex function

Started by andey in Matlab DSP15 years ago

Dear All: I am trying to call Mex function under Matlab. I used the mexFunction without arguments, i.e. nlhs = 0 and nrhs=0....

Dear All: I am trying to call Mex function under Matlab. I used the mexFunction without arguments, i.e. nlhs = 0 and nrhs=0. All my data are read or written inside C++ program. But when I try to read a large number of ascii data for example, an array of 100. The mex function a


MEX functions and random numbers

Started by gkaf...@yahoo.gr in Matlab DSP9 years ago

Hello all, I want to write a MEX function to import a part of C code into MATLAB. This piece of code is a normally distributed random number...

Hello all, I want to write a MEX function to import a part of C code into MATLAB. This piece of code is a normally distributed random number generator. It is controlled by a seed() function which has to be called to initialize the algorithm. What I am trying to do is to call this seed() function inside the MEX file using a specific number as its arguments (seed(10), for example) in order to get ...


deploying standalone application with mex files

Started by sjoh...@cnbc.cmu.edu in Matlab DSP9 years ago

Hi , I am having trouble using deploytool to compile and package my application on windows. I am using Maltab R2008a. My source has lots of...

Hi , I am having trouble using deploytool to compile and package my application on windows. I am using Maltab R2008a. My source has lots of m files and a few C mex files. I am able to compile the mex files successfully and run them without any issues. However,w hen I try to compile the entire application using deploytool, it produces errors like 'undefined reference to mexFunction' ,'Und...


Compiling Fortran Mex on Solaris

Started by Drabot, Slawek in Matlab DSP16 years ago

Hi, I'm trying to compile Fortran mex files on Solaris (2.6) using g77 (gnu Fortran 77 compiler). It compiles and links without...

Hi, I'm trying to compile Fortran mex files on Solaris (2.6) using g77 (gnu Fortran 77 compiler). It compiles and links without producing errors, however Matlab rejects the mexsol file; "invalid mex file". Although MathWorks have told me that Gnu Fortran compiler is


doubt regarding c-mex s-function

Started by raju_zm in Matlab DSP10 years ago

hai to all.I have ascii c-program.how i get c-mex s-function from that c-code.so that i can use it as simulink block. i tried...

hai to all.I have ascii c-program.how i get c-mex s-function from that c-code.so that i can use it as simulink block. i tried 'mcc'command to convert .m file to mex file.when i specify this name for s-function it gives some error. i can write matlab code and ascii c-program.but i have to control the system through matlab-simulink. THANKS IN ADVAN...


Segmentation errors with MEX files

Started by Palani S in Matlab DSP14 years ago 1 reply

Greetings everyone, I've only started using MEX file feature in MATLAB and I have run into several problems which I would like...

Greetings everyone, I've only started using MEX file feature in MATLAB and I have run into several problems which I would like to clarify (some of them may be very specific to my C code, yet I do not understand the reasons why they happened in the first place). I


Re: MEX Compiler and comments in C

Started by Sergio Dominguez in Matlab DSP15 years ago

Hi all! I am sending this as it looks like it is not only me. has anyone figured out how to solve the comments problem with...

Hi all! I am sending this as it looks like it is not only me. has anyone figured out how to solve the comments problem with compiling s-functions with mex in linux? namely: If comments are written like // it crashes. Comments like /* comment *


Creating C++ Mex files ?

Started by Nitin Nangare in Matlab DSP15 years ago

Does anyone has any technical documents abt. creating C++ mex files ? Thanks in Advance.Nitin.

Does anyone has any technical documents abt. creating C++ mex files ? Thanks in Advance.Nitin.


mex compiling

Started by invictus_4_ever in Matlab DSP15 years ago

hi, when trying to compile a mex , matlab is giving an error stating the some required files are not found in the path. The @INC...

hi, when trying to compile a mex , matlab is giving an error stating the some required files are not found in the path. The @INC variable shows some wrong path. how do i change the contents of the @INC variable.


Matlab compiler

Started by pitcz_03 in Matlab DSP14 years ago

Hi, I would like to choose the compiler for mex-file. But when I wrote command: mex -setup I got message: "Select a compiler:"...

Hi, I would like to choose the compiler for mex-file. But when I wrote command: mex -setup I got message: "Select a compiler:" and I had just one option: [1] LCC compiler. But I had intalled a MS Visual C in my computer and I would like to use this


invalid mex file

Started by rsvas2001 in Matlab DSP13 years ago

Hello group, I got an Simulink s-function block from somebody, including source,header files, object files, dlls. when i...

Hello group, I got an Simulink s-function block from somebody, including source,header files, object files, dlls. when i tried to run this model in my matlab i am getting errors Unable to load mex file The specified procedure could not be found


How to mex "linprog"

Started by spottie3 in Matlab DSP14 years ago 1 reply

Hi, I am running 1000's of simulations that call linprog in MATLAB. I have found that much of the computing time is spent in...

Hi, I am running 1000's of simulations that call linprog in MATLAB. I have found that much of the computing time is spent in linprog. I have tried streamlining my code using vectorization, memory pre- allocation, and mex files when possible. However, when I try to


Mex need help!

Started by jihong1974 in Matlab DSP15 years ago

hi, I'm using matlay 6.5 windows version. I have a C file which plots some dots on screen. When I try to convert it to mex file...

hi, I'm using matlay 6.5 windows version. I have a C file which plots some dots on screen. When I try to convert it to mex file with the method introdued in matlab menue, it returned: can't open "graphics.h", which is a C head file. Why? It is highly appriciate


S Function Builder - C Mex files

Started by lee_xmen in Matlab DSP13 years ago 1 reply

Hi , I'm working on C-MEX files ,using S-Function Builder .... A very basic problem,. I have two input arrays u0[5]...

Hi , I'm working on C-MEX files ,using S-Function Builder .... A very basic problem,. I have two input arrays u0[5] and u1[3] and the output is y0[5],. computing the output via for(i=0;i<5;i++) for(k=0;k<3;k++) y0[i] = u0[i]+