Azzera filtri
Azzera filtri

coder using static memory allocation.

1 visualizzazione (ultimi 30 giorni)
clemens raben
clemens raben il 18 Gen 2016
Risposto: Rebecca Krosnick il 20 Gen 2016
Hello, I use the matlab coder to create a dynamic lib from matlab code. I will like to use static memory allocation. However, I get a compilation error for a piece of code. The code is simplified.
out = function (s)
size_s = size(s,2);
start = 1;
for i=1:size_s
....
bracket_end = bracket_end + 1;
if ()
break;
end;
end;
store =[start:brack_end]'
s(1,store) = [...];
An error pop-ups that the size of s is unbounded. So I try to use the assert like
assert(size(store,2) < 10000); % 10000 >> size (s,2);
This is not solving the problem. Then I have use the coder.var_size('data', [1, size(s,2)]), but this does not solve the problem. I'm using matlab 2015b. How can I solve the problem?
Thanks in advance, Clemens

Risposte (1)

Rebecca Krosnick
Rebecca Krosnick il 20 Gen 2016
You can configure MATLAB Coder to use static memory allocation by following the instructions at this link: http://www.mathworks.com/help/coder/ug/code-generation-for-variable-size-data.html#bsyxdsu

Categorie

Scopri di più su MATLAB Coder in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by