mex

C# WCF works inside corporate firewall but not outside...

I am running into an “interesting” error with my WCF JSONP web service. It is the only one I have and it only exposes one method. If I hit my service via web browser internally it pops up with a message that, effectively, MEX is not enabled (true). If I hit it from outside our network (like you would unless you were on a machine in my...

shared library locations for matlab mex files:

hello; I am trying to write a matlab mex function which uses libhdf5; My Linux install provides libhdf5-1.8 shared libraries and headers. However, my version of Matlab, r2007b, provides a libhdf5.so from the 1.6 release. (Matlab .mat files bootstrap hdf5, evidently). When I compile the mex, it segfaults in Matlab. If I downgrade my vers...

MATLAB arbitrary code execution

I am writing an automatic grader program under linux. There are several graders written in MATLAB, so I want to tie them all together and let students run a program to do an assignment, and have them choose the assignment. I am using a C++ main program, which then has mcc-compiled MATLAB libraries linked to it. Specifically, my progra...

WCF Web Service chnage wsdl name and targetNamespace

All, I'm a little new to WCF over IIS but have done some ASMX web services before. My WCF service is up and running but the helper page generated by the web service for me has the default names, i.e. the page that says: You have created a service. To test this service, you will need to create a client and use it to call the service. Y...

MEX-File to Output Pulse in a Loop to a DAQ-Board

Hi there, i figured I must use a MEX-File to output Digital pulses in a loop (40 kHz) from Matlab to my DAQ-Board, I have some APIs from the DAQ-Board vendor, but I really dont know if they are useful. It´s a big documentation on the Mathworks website about MEX-File and APIs, that just make me confused. So I´m asking here if someone ca...

openmp in mex : stackoverflow error

i have got the following fraction of code that getting me the stack overflow error #pragma omp parallel shared(Mo1, Mo2, sum_normalized_p_gn, Data, Mean_Out,Covar_Out,Prior_Out, det) private(i) num_threads( number_threads ) { //every thread has a new copy double* normalized_p_gn = (double*)malloc(NMIX*sizeof(dou...

All about WSDL vs MEX?

I am not able to open the meta data url - http://localhost:8082/Tasks/mex I have added the mexhttpBinding in the config file. Can I see this mex endpoint in browser? The config files look like: <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> Questions: Is Mex is differ from WSDL? If no, why do we r...

How to access a matrix in a matlab struct's field from a mex function?

I'm trying to figure out how to access a matrix that is stored in a field in a matlab structure from a mex function. That's awfully long winded... Let me explain: I have a matlab struct that was defined like the following: matrixStruct = struct('matrix', {4, 4, 4; 5, 5, 5; 6, 6 ,6}) I have a mex function in which I would like to be...

How to create a string array in matlab?

I would like to pass a vector of strings from C++ to matlab. I have tried using the functions available such as mxCreateCharMatrixFromStrings but it doesn't give me the correct behavior. So, I have something like this: void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { vector<string> stringVecto...

MATLAB Mex files

Is there a way to get the mex file for a built-in MATLAB m- file? If yes, how? If no, does that mean I have to write the C code myself (oh nooo!!!) ...

processing files in 64 bit machine but developing in 32 bit machine

i am going to read a TDMS file in matlab using Mexfunction in C language in a 64 bit windows machine, but i will develop the app in 32 bit windows machine. i know in there is a difference between 32 bit machine and 64 bits with the size of variables. i used a lot of fread(.. sizeof(type)..). is it going to be a problem when it is running...

MySQL and MATLAB 64 bit

I'm trying to connect to MySQL using MATLAB R2009b 64 bit and the mysql.cpp file found on the FEX and here. I followed all the steps to compile listed in the second link. After entering the following: mex -I"C:\mysql\include" -DWIN32 mysql.cpp "C:\mysql\lib\opt\libmySQL.lib" the mysql.mexw64 file is created in my working directory. Ho...

what is service metadata and why it's necessary to publish?

There is ABC (addres, binding, contract) = endpoint. I thought this information is enough to communicate with clients and vice versa. But what is metadata and mex? ...

OpenCV, Matlab and STL containers

Many functions in the latest release of OpenCV require the use of STL containers. I run into problems when trying to use them in a Matlab MEX file. I am compiling the MEX files from within Matlab. Both OpenCV and Matlab use the "/MD" flag which is "Multithreaded DLL" for code generation. Compiler: MSVC++ 9.0 Matlab 2010a OpenCV latest f...

How do I diagnose why a .so file won't load when executing a .mex file in MATLAB?

I'm trying to use a video library called VideoIO with MATLAB for a machine learning project. When I try to invoke the library in MATLAB, I get an error saying that it can't find libavutil.so.50, one of the ffmpeg libraries that VideoIO depends on. I've checked a few different things but can't find anything that looks wrong, other than th...

Compiling C code for 64-bit Matlab on Intel MAC

Hi all, I need compile a piece of C code to be called from matlab (mex compiling). I am doing that on an intel mac and, since I am using Matlab's R2010a (7.10.0.499), I'd like to compile the C code into a version for 64-bits. For whatever reason, just doing mex with the -arch=maci64 option did not seem to work... As a way around, I...

Force explicit variable declaration with gfortran

I am linking some fortran code (f90) from matlab using mex and I am having matlab freeze occasionally. In the past, I had freezing happening due to mismatch between data types (say integer*4 vs integer*8). The code I am linking has many implicitly defined variables, so I am wondering if there is a hidden data type conflict that only o...

How to expose WCF4 metadata endpoint in ASP.NET MVC 2 app

I have a ASP.NET MVC 2 application with WCF service defined in it (.svc file using service from a different project). web.config WCF section looks like this: <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="RecordServiceAspNetAjaxBehavior"> <enableWebScript /> </behavior> </endpointBehaviors> <se...

Wrong URL in WSDL hyperlink when using WCF (https)

I got my WCF Service running with HTTPS, It shows the Infopage, but the URL below "To test this service, ... with the following syntax:" is: svcutil.exe https://servername.group.service.com/MyService.svc?wsdl (full address of the server) Instead of the correct URL https://my.service.com/MyService.svc?wsdl (assigned hostheader), how can...

There was no endpoint listening at <urlToMex> that could accept the message.

I have a WCF-service running inside a windows service. There is an mex-endpoint at http://localhost/... I can navigate to it via a browser but if I use MetadataResolver.Resolve, the above mentioned exception will be thrown (with inner exception of "The remote server returned an error: (404) Not Found."). The only difference I spotted i...