Anyone please help me, i have matlab code want to generate to c code using matlab coder. But i have error 'Code generation does not support variable 'min_path_index' size growth through indexing'.

1 view (last 30 days)
My code :
min_path_index(minu_count, :) = [sx sy];
How to fix error 'code generation does not support variable 'min_path_index' size growth through indexing'?
  2 Comments
Sandro Lecci
Sandro Lecci on 18 May 2018
Hi,
Are you defining the size of min_path_index before you use it? If not it might be because you did not allocate the memory for this variable and languages as C don't like variables that change size.
Just my guess..
Sandro
Dicki Andrea
Dicki Andrea on 20 May 2018
Thanks you Mr. Sandro for your response my questions.
Done, i declare min_path_index with zero (min_path_index = [] )

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!