mex

How to use dll generated by visual studio in another machine without visual studio installed?

旧时模样 提交于 2019-12-20 05:46:32
问题 I have generated dynamic library in visual studio 2012. I want to use that library in another machine, but I don't want to install visual studio in remote machine. I have mex library and dll and I want to run a script which uses both libraries. When I run the script I got the following error. "Missing shared libraries: MSVCR110D.dll, MSVCP110D.dll" Where do I need to place those dll's inorder to run my script file in matlab. 回答1: MSVCR110D.dll and MSVCP110D.dll are debug libraries. If your

How to use dll generated by visual studio in another machine without visual studio installed?

落爺英雄遲暮 提交于 2019-12-20 05:46:19
问题 I have generated dynamic library in visual studio 2012. I want to use that library in another machine, but I don't want to install visual studio in remote machine. I have mex library and dll and I want to run a script which uses both libraries. When I run the script I got the following error. "Missing shared libraries: MSVCR110D.dll, MSVCP110D.dll" Where do I need to place those dll's inorder to run my script file in matlab. 回答1: MSVCR110D.dll and MSVCP110D.dll are debug libraries. If your

Error when compiling c++11 code in a Matlab mex file

狂风中的少年 提交于 2019-12-19 09:47:19
问题 I have downloaded the following code: CVPR 2014 intersection over union optimization code cvpr2014-iou-code-1.0.zip http://research.microsoft.com/en-us/downloads/e164fe21-ef2b-4e34-98c1-4868968abb06/ What I get is an archive with two folders, one called src/ and another one called matlab/ . I am running Linux Fedora 19 and I can compile the code in src/ just fine. The problem arises when I try to compile the code in matlab/ . The README says: Matlab compilation ------------------ From within

Creating sparse matrix in MEX

陌路散爱 提交于 2019-12-18 16:52:06
问题 How to create a 2d sparse matrix in a MEX-file written in C. After creating the matrix how to access the elements individually like in C , say mat[i][j] ? I tired using mxCreateNumericArray function but I wasn't able to access the elements and also make it as a sparse matrix. Please help 回答1: See this page on mxCreateSparse. Then you'll want to look at mxSetPr, mxSetIr and mxSetJc and the corresponding "get" versions. Here's an example of how to allocate a sparse matrix. I realize this is an

matlab compiler installation problems

五迷三道 提交于 2019-12-18 13:04:40
问题 I'm trying to run a compiler on MATLAB but things don't go as expected. How can I properly install MATLAB and how can I check what exactly is going wrong. I have the MATLAB r2013a version. I've done as follow: I've downloaded the SDK 7.1 file from here destination folder for Tools: C:\Program Files\Microsoft SDKs\Windows\v7.1 destination folder for Samples: C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples I've added my compiler directories to the path environment Control Panel -> System -

Matlab 2013b generated code produces Undefined symbols for architecture x86_64 error in mex

心不动则不痛 提交于 2019-12-18 09:06:18
问题 I have a C-Code generated by the Simulink Coder that I need to use in a C S-function. This may sound a bit strange but I need this Code to be executed multiple times within the s-function before writing the outputs of the s-function (it's an evolutionary algorithm that needs to simulate a prediction for a lot of individuals before evaluation and ranking...but those details do not really matter). The Problem is that I seem to have a problem with the 64bit instruction set when trying to mex my

How to compute sum of binomial more efficiently?

社会主义新天地 提交于 2019-12-18 07:22:37
问题 I must calculate an equation as follows: where k1,k2 are given. I am using MATLAB to compute P . I think I have a correct implementation for the above equation. However, my implementation is so slow. I think the issue is from binomial coefficient. From the equation, could I have an efficient way to speed up the time? Thank all. For k1=150; k2=150; D=200; , it takes 11.6 seconds function main warning ('off'); function test_binom() k1=150; k2=150; D=200; P=0; for i=0:D-1 for j=0:i if (i-j>k2||j

/usr/../libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by …)

烂漫一生 提交于 2019-12-18 07:14:34
问题 I have been stuck on this problem for several weeks and been looking around on Internet for solution but so far not so good... So I have a program written by someone else and I try to compile it in Matlab to make it work. My computer is Red-hat enterprise Linux workstation (64 bits) with gcc 4.4.3 and Matlab 2011b installed. The gcc is compatible with my Matlab (http://www.mathworks.com/support/compilers/R2011b/glnxa64.html). The compilation works fine (I mean, no error message occurs in

Correctly over-loading a stringbuf to replace cout in a MATLAB mex file

99封情书 提交于 2019-12-18 03:36:09
问题 MathWorks currently doesn't allow you to use cout from a mex file when the MATLAB desktop is open because they have redirected stdout. Their current workaround is providing a function, mexPrintf, that they request you use instead. After googling around a bit, I think that it's possible to extend the std::stringbuf class to do what I need. Here's what I have so far. Is this robust enough, or are there other methods I need to overload or a better way to do this? (Looking for portability in a

How to tell mex to link with the libstdc++.so.6 in /usr/lib instead of the one in the MATLAB directory?

拟墨画扇 提交于 2019-12-17 09:42:45
问题 Now mex in MATLAB 2012a only officially supports gcc 4.4.6 but I want to use gcc 4.7 at my own risk. Now If I compile something with mex directly, it will complain that /usr/lib/gcc/i686-linux-gnu/4.7/cc1plus: /usr/local/MATLAB/R2012a/sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /usr/lib/i386-linux-gnu/libppl_c.so.4) /usr/lib/gcc/i686-linux-gnu/4.7/cc1plus: /usr/local/MATLAB/R2012a/sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by