Fixed variable range in code translation
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
VaL V6
am 22 Apr. 2020
Beantwortet: David Fink
am 4 Mai 2020
Hi,
I'm trying to translate in C the following code:
function [merging_flag,frameRGB_3] = merging_function(check,frame,frame_2,frameRGB_2)
%% Initialization
merging_flag = true;
row = check.frame_shift; % type uint16
colum_DL = check.DL_dimension.width; % type uint16
colum_IR = check.IR_dimension.width; % type uint16
Filler_M_DL = zeros([row colum_DL],'uint8');
Filler_M_IR = zeros([row colum_IR],'uint8');
...
The error occurs when the coder tries to translate Filler_m_DL e Filler_M_DL:
"Computed maximum size exceeds maximum allowed number of elements (134217728). The computed size is [:65535 x :65535]. Please consider enabling dynamic memory allocation to allow unbounded sizes".
Therefore the coder considers the variables row, colum_DL e column_IR (that are scalars) as the can space between 0 and 65535 (maximum representable value with uint16 type) but I know that those values will space between 0 ans 1000.
Is there a way to define this range for the variables and avoid to allow the dynamic memory allocation?
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!