All Questions
Tagged with matlab-coder code-generation
22 questions
1
vote
0
answers
242
views
bwboundaries() C++ code Generation Error?
I have enabled dynamic memory allocation in Simulation Target>Advanced with default threshold as 0. Then I attempt to run this code:
B={{nan}}; %%Defining so that it can be set as size variable.
...
2
votes
1
answer
1k
views
Can MATLAB Coder generate a function that takes a pointer as input?
I would like to use MATLAB Coder to generate an executable (or a function in an object file) that accepts a pointer to an array as an input.
I used libpointer to create a pointer object and then tried ...
2
votes
1
answer
761
views
Can MATLAB C generation coder generate C-code that fits embedded system?
I need to convert this code into C code.
Questions:
Will MATLAB Coder generate C code that are memory safe, e.g they not using calloc or malloc. Misra C standard does not allow coder to use dynamical ...
1
vote
1
answer
617
views
String comparison on cell array of strings with Matlab Coder
I am trying to use the MATLAB Coder toolbox to convert the following code into C:
function [idx] = list_iterator(compare, list)
idx = nan(length(list));
for j = 1:length(list)
idx(j) = strcmp(...
4
votes
1
answer
393
views
Cannot convert Matlab code to C code using Matlab Coder
I have a MATLAB code shown in below. I am trying to convert this code to C code using MATLAB Coder but I encountered an error.
Expected either a logical, char, int, fi, single, or double. Found an ...
0
votes
0
answers
243
views
matlab compile to C: detect slbuild vs coder
Apparently slbuild has severe limitations on the size of arrays that it supports. MATLAB Coder gives me options to convert those to dynamic memory. I don't see how to do that with 'slbuild'. However, ...
11
votes
2
answers
2k
views
How MATLAB code generation infers output size with nested branches
When generating C code using MATLAB Coder, the behaviour is different when an if happens in body of another if or in its elsesection. The following case easily creates C code with output having size ...
1
vote
1
answer
2k
views
Get the data out of the emxArray_real_T
I have converted a simple code to C++ using Matlab coder. However, my main problem is that I cannot get its output! How can I convert the output which is an emxArray_real_T type to a C++ array and ...
2
votes
1
answer
989
views
Matlab Codgen eig() function - strange behaviour
First, don't be fooled by the long post, there is not a lot of code just an observation of results so there are few example matrices.
This is a bit related to this question: Matlab Codegen Eig ...
6
votes
1
answer
7k
views
switch-case with multiple matches in matlab for code generation
The following code is valid matlab sytax to check whether b matches any elements in a. However, if the code is used for code generation (i.e. simulink) then I get the error:
'code generation only ...
2
votes
0
answers
270
views
MATLAB to C codegen build error - input properties specification mismatch
I am trying to build a C/C++ static library from MATLAB code, but receive the following error:
"Function 'application' input properties specification mismatch:
expected 0 but found 2."
Here is the ...
2
votes
1
answer
1k
views
Alternatives to extrinsic functions such as imread and other functions during code generation in MATLAB
As you may know, extrinsic functions are not outputted during the code generation process. Are there alternatives to these functions and/or solutions to this problem? My code generation error report ...
3
votes
1
answer
2k
views
MATLAB Coder dynamically sized array of structs
I'm trying to use a dynamically growing array of structs in a piece of code that is supposed to be converted to C with Coder:
I initialize the struct and then declare its fields variable size for ...
0
votes
1
answer
29
views
Getting two parameters from c function in matlab
i had a code that c send back 1 number (mex)
the matlab code was
vMsg=unit32(Gateway_test_app(2))
now i added 1 more return value to Gateway_test_app(2) which is s STRING
what i need to do to get the ...
2
votes
2
answers
3k
views
undefined reference to `rtIsNaN'
I am trying my hands with Matlab coder. I wrote a simple matlab script and generated the C-code (along with the necessary headers) for the same. The matlab script looks like this :
function amin_idx=...