matlab-deployment

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

How to find the coordinates of nonzero elements of a 3-D matrix?

流过昼夜 提交于 2019-12-14 04:12:41
问题 I have a 3D matrix A , the size of which is 40*40*20 double. The values in 3D matrix is either "0" or "1" . The number of "1" in matrix A is 50. I know how to find the corresponding coordinates of the 3D matrix. The code looks like this: [x y z] = ind2sub(size(A),find(A)); coords = [x y z]; My question is how to just find the coordinates [xi yi zi] (i=1,2,...,50) of the nonzero elements in 3D matrix A , and then assign values a1, a2, a3, ..., a50 to the corresponding coordinates [xi yi zi] (i

How to setup MCR_CACHE_ROOT in Windows

♀尐吖头ヾ 提交于 2019-12-13 00:37:24
问题 I know this may be an easy question but How can I setup MCR_CACHE_ROOT in Windows? Can you provide me with the detailed steps. And where should I point the path to MCR_CACHE_ROOT to speed up my compiled application startup time? 回答1: For Windows 7, you set it as an environment variable as follows: Click Start then right-click on Computer and choose Properties from the menu. In the System window, click Advanced system settings in the left panel. In the System properties dialog, select the

find common values of all rows of a matrix

三世轮回 提交于 2019-12-13 00:27:51
问题 I have a random generated matrix A =[ 0.7015 -1.577 -1.333 0.022 -0.5 -2.00 -0.034 -0.714 -2.05 -0.5 1.12 -0.26 -0.97 0.96 -0.79 1.35 -0.353 0.28 -0.5 -1.75 -1.15 0.52 1.018 -0.22 -0.8 0.033 -0.29 -0.28 -0.5 -0.02 -0.13 -0.58 ] I want to find the common values of all rows.Each row has no duplicated elements. Can anyone give me a help? 回答1: Get a vector of unique values with unique, and then compare each element of A with each unique value using bsxfun: u = unique(A); m = squeeze(all(any

Matlab Compiler MCC errors on imports for Java classes from dynamic Java classpath

点点圈 提交于 2019-12-12 21:13:23
问题 How can I get mcc to recognize imports from user-provided Java libraries, or to simply ignore unresolvable imports? I have a Matlab codebase that I'm building with the Matlab Compiler, but the build is breaking because mcc is erroring out when it encounters import statements for Java classes that were in JARs on Matlab's dynamic classpath. I am including all the JAR files on the classpath with the mcc -a option. The code works in the IDE, and I think it will work in the deployed app, if 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

MCR_CACHE_ROOT path empty after running the console application

回眸只為那壹抹淺笑 提交于 2019-12-12 05:05:34
问题 I set the MCR_CACHE_ROOT to a folder C:\MATLAB_cache to speed up my compiled application. Using the linke below How to setup MCR_CACHE_ROOT in Windows But after I ran the console application calling it from PHP the folder is still empty.Why is it? Should I add anything in my console application or php code after setting up the MCR_CACHE_ROOT? I am working on Windows 7-64bit. The console application is C++ Win32 console application. I deployed a c++ shared library using deploytool in MATLAB

Matlab Graph Plotting

时光怂恿深爱的人放手 提交于 2019-12-12 01:34:19
问题 Given t1,t2,t3,t4 as real value parameters, and the constraints of the following format: (t1>=0 and t2>=0 and t3>=0 and t4>=0) and ((t2<=5) or (t1+t2+t3+t4<=3)) Could this constraint be plotted using the .net library of matlab? (I am using C#). My concern is: 1. This has four dimension, I am not sure how is the graph can be represented in Matlab; 2. And basically this constraint might result in a convex polygon, can such polygon been drawn in Matlab? I am totally new in Matlab, therefore if

Calling Matlab Compiler from inside C# app throws exception

点点圈 提交于 2019-12-11 13:53:11
问题 I found this code to invoke the Matlab compiler, it works fine when the function is called from Matlab command prompt, I build this function to .Net Assembly but whenever I try to use it in my C# app in order to build some .m file I get an exception, where do you think my problem is? Matlab Code: function compileCode(mfile,dllName , dnetdir) %% Create directories if needed if (exist(dnetdir, 'dir') ~= 7) mkdir(dnetdir); end %% Build .NET Assembly eval(['mcc -N -d ''' dnetdir ''' -W ''dotnet:'

Pass C# object[] to Matlab Dll method

倾然丶 夕夏残阳落幕 提交于 2019-12-11 13:45:23
问题 I am trying to pass a C# object array to a Matlab method using parameter array params keyword. My Matlab method is complied to a .net assembly Dll. Here is my simple c# method: public void Method1(params object[] objArg) { _mMExt.mMethod1((MWArray[])objArg); } I am using varargin as input for my Matlab function mMethod1: function mMethod1(varargin) nVarargs = length(varargin); end The issue is when I am converting object[] to MWArray[] by doing this: (MWArray[])objArg It seems that I can use