Borrar filtros
Borrar filtros

coder using static memory allocation.

1 visualización (últimos 30 días)
clemens raben
clemens raben el 18 de En. de 2016
Respondida: Rebecca Krosnick el 20 de En. de 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

Respuestas (1)

Rebecca Krosnick
Rebecca Krosnick el 20 de En. de 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

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by