matlab-compiler

How to initialize and load MCR

痞子三分冷 提交于 2019-12-23 16:43:38
问题 I incorporated C++ shared library generated from MATLAB in a Win32 console application. The MATLAB program takes 2-3 sec to execute in MATLAB but the console application takes 11-12 seconds to execute. I read this is because of the start up time of MCR and I believe after the MCR is initialized it must take same time as it takes in matlab. So how can I load or initialize the MCR so that it is always in the RAM or cache so that it will take 2-3 sec for the console application to run? Should I

Converting Matlab to C++

混江龙づ霸主 提交于 2019-12-19 19:54:33
问题 I need to convert some MATLAB code to C++. I am using Visual Studio 2010 and have MATLAB compiler installed. I am wondering how do I go about doing this. Also when I publish my project will the end user have to install anything by MATLAB? (this cannot be the case) 回答1: You can compile Matlab scripts into standalone executables, but I'm not familiar with a Matlab tool to convert Matlab code to Visual C++ code. You can convert Matlab code to C or C++ using Simulink Coder (formerly Real-Time

Exception when initialize dll in c# generated by MATLAB Compiler

有些话、适合烂在心里 提交于 2019-12-18 07:24:24
问题 I used the MATLAB Compiler to generate a .NET Assembly with a very little MATLAB code: function output_arg = extest( input_arg1,input_arg2 ) output_arg = input_arg1+input_arg2; end I generated the dll with the wizard. Within my Visual Studio project I added the reference to the generated dll ( extest.dll ) and to the MATLAB Runtime dll ( C:\Program Files\MATLAB\MATLAB Runtime\v92\toolbox\dotnetbuilder\bin\win64\v4.0\MWArray.dll ) as mentioned in the "Assembly Description". This is my c# code:

Exception when initialize dll in c# generated by MATLAB Compiler

可紊 提交于 2019-12-18 07:24:06
问题 I used the MATLAB Compiler to generate a .NET Assembly with a very little MATLAB code: function output_arg = extest( input_arg1,input_arg2 ) output_arg = input_arg1+input_arg2; end I generated the dll with the wizard. Within my Visual Studio project I added the reference to the generated dll ( extest.dll ) and to the MATLAB Runtime dll ( C:\Program Files\MATLAB\MATLAB Runtime\v92\toolbox\dotnetbuilder\bin\win64\v4.0\MWArray.dll ) as mentioned in the "Assembly Description". This is my c# code:

How to compile Matlab class into C lib?

旧城冷巷雨未停 提交于 2019-12-18 06:48:09
问题 The origin of this question is from here How to use "global static" variable in matlab function called in c. I'm trying to encapsulate the "global variable" into an object. However I don't know how to export the matlab class to c++ using MATLAB Compiler (mcc) To do this I just tried the standard command Matlab Command mcc -W cpplib:Vowel4 -T link:lib Vowel4.m Matlab Script classdef Vowel4 properties x y end methods Vowel4 A B end end The generated lib is actually stand-alone functions rather

How can I pass command line arguments to a standalone MATLAB executable running on Linux/Unix?

扶醉桌前 提交于 2019-12-17 18:26:10
问题 How can I pass command line arguments to a standalone MATLAB executable running on Linux/UNIX? I need to compile my MATLAB script as a standalone file that can be run on a machine without MATLAB present. It needs to be able to work in a way similar to C's argv[] , where you do the following: Command line: myfile argument1.txt argument2.txt where argument 1 and 2 are the input and output files. The exact syntax doesn't matter, but it should work like argv[] . What is a function that could do

MATLAB Compiler vs MATLAB Coder

隐身守侯 提交于 2019-12-17 08:25:33
问题 What's the difference between the two? As far as I understand it, MATLAB Compiler wraps the MATLAB code into a .exe file so that it can be used without installing MATLAB, and only requires the MCR. On top of it MATLAB Builder NE can also be used to produce .Net assemblies to be used with .Net framework instead of the .exe file, but they still require MCR. Now I don't understand what MATLAB Coder used for? It generates C/C++ code. But is the MATLAB code really converted into C/C++, or is it

MATLAB Compiler vs MATLAB Coder

无人久伴 提交于 2019-12-17 08:25:14
问题 What's the difference between the two? As far as I understand it, MATLAB Compiler wraps the MATLAB code into a .exe file so that it can be used without installing MATLAB, and only requires the MCR. On top of it MATLAB Builder NE can also be used to produce .Net assemblies to be used with .Net framework instead of the .exe file, but they still require MCR. Now I don't understand what MATLAB Coder used for? It generates C/C++ code. But is the MATLAB code really converted into C/C++, or is it

Matlab: How to survey compiled m-code progression from external API?

﹥>﹥吖頭↗ 提交于 2019-12-12 10:54:24
问题 My question is extremely specific to the arcanes of the matlab compiler and runtime. As only people familiar with matlab runtime API may answer, I shortened much details. Please let me know if I should be more verbose. Introduction Using the matlab compiler & runtime I can call a function written in m-code from a C# program. Let's say calling: function [result] = foo(n) %[ result = 0; for k = 1:n, pause(1.0); % simulate long processing result = result + 42; end %] with (somewhere behind some

MatLab Coder - MatLab to C

断了今生、忘了曾经 提交于 2019-12-12 06:15:37
问题 I am trying to run MatLab Coder to transform a matlab .m file into .mex to hopefully run the code more quickly. When trying to build the file via MatLab Coder engine, I get the following error: Undefined function or variable 'k'. The first assignment to a local variable determines its class. k is determined inside a previous loop. My guess is that C code cannot "remember" values inside an earlier loop. How can I come around this? Any help is appreciated. Thanks. 回答1: Since all of "Undefined