I’m trying to compile a c++ mex function that I created according to the specifications given by mathworks here (Create a C++ MEX Source File). However, after following the steps of the answer in this thread to link Eclipse 4.4.2 and Matlab R2015a in a linux enviroment (old but the only one I’ve found about ..

#### Category : mex

GCC version: 10.3.0 I have a C and C++ project, for which I compile MEX files so it may be run in a MATLAB program. It is compiled in a makefile outside of MATLAB rather than inside MATLAB. Just a few days ago, I was able to compile and run these MEX files fine. Now ..

I have a Matlab mex file. This mex file is provided by other guys so I cannot access the code. Can anyone help me to read this file in C++ application (mainly required library & functions to read file) ? A pseudo code will be helpful to understand approach. Thanks in advance! I have very ..

I’m trying to build an audio plug-in in Matlab2021a and Xcode12.5.1 using MEX, but when I run: mex -setup C++ I get the error: "Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement" despite having accepted the license agreement. Any thoughts on how to solve this? ..

I’ve been using a MATLAB program to perform some gridding for the past couple days and all of a sudden it stopped working and started giving the following error message: Invalid MEX-file ‘/home/user/ReconCode/gpuNUFFT-master/gpuNUFFT/@gpuNUFFT/private/mex_gpuNUFFT_precomp_f.mexa64′: libcufft.so.7.5: cannot open shared object file: No such file or directory. Error in gpuNUFFT (line 104) [res.op.dataIndices,res.op.sectorDataCount,res.op.densSorted,res.op.coords,res.op.sectorCenters,res.op.sectorProcessingOrder,res.op.deapoFunction] = mex_gpuNUFFT_precomp_f(single(k)’,single(w)’,res.op.params); Error in MCNUFFT_GPU_indv ..

I am trying to use a .mexmaci64 function in MatLab. This function is working on the (Mac) machine of the person who compiled the .mexmaci64 file. MatLab R2021a on my Windows 10 machine gives me the common error: Unrecognized function or variable ‘filename’. for a file named "filename.mexmaci64". I have confirmed that: The file name ..

This question shows how to return a double matrix to matlab using a map object. Pass C++ Eigen matrix to Matlab mex output The following works for non-complex data. double *outputPtr; plhs[0] = mxCreateDoubleMatrix((mwSize)n, (mwSize)m, mxREAL); outputPtr = mxGetPr(plhs[0]); Map<MatrixXd> output(outputPtr, n, m); Since matlab stores real and complex elements of a matrix separately rather ..

I have a problem with MEX files in C/C++ coding. I need to return a double complex array to Matlab but I am not able to do that and I don’t find information about it. I show my code with some tries: double complex output[nSymb]; nlhs = 1; plhs[0] = mxCreateDoubleMatrix(nSymb,(mwSize)nlhs,mxCOMPLEX); plhs[0] = output; memcpy(plhs, ..

I have compiled mex file from C++ code: #include "mex.h" #include "matrix.h" #include "fdtd-macro.h" #include "copyMatrix.cpp" #include "global_var.h" int nx,ny,nz,linearSizeEx,linearSizeEy,linearSizeEz; int ExM,ExN,ExP,EyM,EyN,EyP,EzM,EzN,EzP,HxM,HxN,HxP,HyM,HyN,HyP,HzM,HzN,HzP; double *Ex,*Ey,*Ez,*tmpEx,*tmpEy,*tmpEz; const mwSize *dimEx,*dimEy,*dimEz; const mwSize *dimCexe,*dimCexhy,*dimCexhz,*dimCeye,*dimCeyhx,*dimCeyhz,*dimCeze,*dimCezhx,*dimCezhy; using namespace std; void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[]) { //read input from MATLAB calling Ex = mxGetPr(prhs[0]); Ey = mxGetPr(prhs[1]); Ez ..

I have a c++ code that uses opencv2 library and it includes the mexFunction, I would like to compile the code using matlab for windows 10 how to install opencv and make the correct link between mex and opencv to run it from matlab? Source: Windows Que..

## Recent Comments