Dynamic Memory disabled, Coder help Needed

8 visualizzazioni (ultimi 30 giorni)
Balachander Krishnamurthy
Balachander Krishnamurthy il 27 Ago 2017
Risposto: Nirja Mehta il 30 Ago 2017
This is the original line in my code:
B = zeros(X, ceil(Y/Z));
I want to be able to generate HLS code so allocating dynamic memory is not an option. Disabling the dynamic memory allocation gives the error: Computed maximum size is not bounded. Static memory allocation requires all sizes to be bounded. The computed size is [513 x :?]. Please consider enabling dynamic memory allocation to allow unbounded sizes.
So I modified this to but I am still getting the same error. A = zeros(1, 1); A(1) = ceil(Y/Z); C = zeros(1,1); B = zeros(X, A(1)); Can someone help, please? Thanks, Bala

Risposte (1)

Nirja Mehta
Nirja Mehta il 30 Ago 2017
If you know the maximum size of your variable, place an upper bound on this variable for code generation.
To avoid dynamic memory allocation, provide upper bounds for the array dimensions so that the size of the array, in bytes, is less than the dynamic memory allocation threshold. See Specify Upper Bounds for Variable-Size Arrays .

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