bwlabel with Matlab coder

1 回表示 (過去 30 日間)
Alex Zlotnik
Alex Zlotnik 2015 年 4 月 30 日
回答済み: Sainath Varikuti 2015 年 5 月 1 日
I am trying to convert matlab code to C++ using Matlab Coder. The memory is set not to use dynamic allocation. It fails to convert the function bwlabel , stating the function has some unbounded variables inside, and cannot be converted with static allocation.
Does bwlabel demand dynamic memory allocation, or I could have some other bug in my code?

回答 (1 件)

Sainath Varikuti
Sainath Varikuti 2015 年 5 月 1 日
When generating code for 'bwlabel', the parameter 'n' must be compile time constant as discussed here. Try specifying the upper bound using 'code.varsize' or 'assert' statement in the MATLAB code.

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by