MATLAB Coder™ generates standalone C and C++ code from MATLAB® code. The generated source code is portable and readable.MATLAB Coder supports a subset of core MATLAB language features, including program control constructs, functions, and matrix operations. It can generate MEX functions that let you ...
3
votes
1answer
174 views
get string of enum - matlab coder
I have an enum like this:
classdef(Enumeration) bla_type < int32
enumeration
bla_one(1)
bla_2(2)
end
end
I can get the 'string representation of an element' like this:
...
1
vote
1answer
74 views
Expected scalar value: MATLAB Coder
I get the following error while using MATLAB coder for generating a c++ code from m file with a call to a c function ompmex.c
C function calls always return scalar values but a non-scalar value is ...
1
vote
1answer
112 views
Matlab C++ - Receive Dynamic Size Output type (emxArray_real_T)
I have converted some matlab code to C++ using coder.
void myfunction(const emxArray_real_T *input, emxArray_real_T *output){ ... }
I have setup to send emxArray_real_T type inputs without any ...
1
vote
1answer
137 views
error with nested loops when using matlab coder, however there are NO nesting at all
I try to to use matlab coder to a function with many arrays:
function [y, fv, a_1_1, a_2_1, ..., a_3_1, ...] = test_ff( x, ffW, ffb, kernel_2_1_1, b_2_1, ..., kernel_4_6_12, b_4_12) %#codegen
a_1_1 ...
1
vote
1answer
256 views
When does Matlab choose to thread when using codegen and parfor
I seem to be one of few people using the Matlab coder (codegen command) to get speedup, judging by the fact that there is so little discussion or help on-line. I've gotten incredible speedups from it ...
1
vote
1answer
77 views
Matlab coder reallocation
I have some code like this in my matlab function:
for i = init:end
a= [a, char(zeros(size(a))]
a= func(a)
a = a(a~=0)
end
So, in each step of the loop, you first double the size of a, ...
0
votes
1answer
43 views
How do I create a global Array that increases in size in Simulink
I would like to create a global array within a Matlab function block in Simulink that grows in size, each time the Matlab function block is called. The only approach to create global variables in a ...
0
votes
1answer
146 views
MATLAB Coder: sparse matrix
MATLAB Coder seems to be fancy and can speed up MATLAB code much by converting the code into C/C++ or MEX.. But it seems that it does not support sparse matrix, or the matlab function sparse which is ...
0
votes
1answer
55 views
i want to have a index vector
I want to crop an image. I have initial points(x,y) and width and height of area which I want. but initial points and width and height are not constant. Because I think I can crop with selector. ...
-2
votes
1answer
63 views
Design a 2-D averaging filter that can decrease the effect of noise on the image
Design a 2-D averaging filter that can decrease the effect of noise on the image “waves_noise.jpg”. You can use the image processing toolbox in MATLAB to read images, convert them from RGB to gray ...
1
vote
0answers
100 views
Matlab image converter issue
I want to use the output of Matlab coder for image processing. I created an c++ output from Matlab coder, I would like to use this code for integrating it into some other application. The problem is ...
1
vote
0answers
48 views
Matlab error handling convert to C
I thought of using object oriented design for a Matlab code and later to convert it to C, where at the end it should be used for a DSP - Processor.
What I am not sure about, is how to do the error ...
1
vote
0answers
89 views
Can one white balance an image in YCbCr?
I am currently making an attempt at gesture recognition on a Beagleboard, using Simulink. I have skin segmentation working, but there are some objects that are being segmented along with the skin ...
1
vote
0answers
72 views
Writing the right sax code
i wrote a SAX(symbolic aggregate approximation) classification code using synthetic control training and testing data but it never gives me the right accuracy( i got 0.2 error and the real was 0.02 ...
0
votes
0answers
48 views
Using Matlab Coder capi to change states at runtime
I need to change the states of a Matlab Coder generated application at runtime. I know I can access (and therefore change) the states of a model at runtime via CAPI. Can I just set new values or is ...
0
votes
0answers
59 views
matlab function block does not respond
Im trying to use matlab function block of simulink to evaluate the value of a very long function that is like the one below (but about 1.3 Mb):
qdd24*((3*(cos(q22 + ...
0
votes
0answers
78 views
c code generation for matlab function griddata
In one of my application I am using matlab griddata function. I want to generate c code the same. But it is not supported by the matlab coder. One possible solution is to rewrite the griddata function ...
0
votes
0answers
74 views
Generating multiple entities upon entity or signal arrival in Simevents
I'd need to generate multiple entities in Simevents upon arrival on an entity or a signal, ideally the number of events should derive from an attribute of the incoming event.
There is a very poor ...
0
votes
0answers
71 views
Matlab coder “Error indenting generated C code”
I am Trying to convert a MATLAB code to C++ using MATLAB coder but this error apears:
Error indenting generated C code
The error points to the name of the function itself and has no more ...
0
votes
0answers
73 views
recursive calls are not allowed in matlab coder
I wrote a simulation in MATLAB and now that it works I need to port it to C++ in order for it to be used by the main program in C++.
I wanted to use MATLAB coder for this purpose as I always do but ...
0
votes
0answers
217 views
Integrate Code into Visual Studio using MATLAB Coder
I created a dll file from Mathlab .m files using Matlab coder. In matlab, the matlab code runs fine without any error and DLL creation was successful. MV2010 compiles and runs fine. However, when the ...
0
votes
0answers
70 views
Matlab dll functions
I have problem with interfacing dll file with Visual Studio 2012. With Matlab2013b coder I built a dll from simple function:
function [TOF] = getTOF(array1,array2)
SR = xcorr(array1,array2);
...
0
votes
0answers
143 views
Link static library generated by Matlab coder to Xcode
I'm developing an iOS app. Part of the algorithms is done in Matlab. I used Matlab coder to make it as a static library. I got a file xxxxlib.a
But I can't link it to my Xcode project. I've searched ...