Category : mex

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 ..

Read more

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? ..

Read more

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 ..

Read more

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 ..

Read more

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 ..

Read more

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, ..

Read more

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 ..

Read more