Simulink Error: Code generation does not support object arrays - Matlab Error

7 ビュー (過去 30 日間)
Thomas L'Estrange
Thomas L'Estrange 2020 年 5 月 19 日
回答済み: Krishna Adi 2021 年 1 月 20 日
Hi, I'm trying to code a pathguiding script in simulink however when adding a class block to a vector I get an error stating that object arrays aren't supported. Is there any way around this or an alternative way to add each new class object to the vector?
Thanks
Code Utilized:
OpenList=[OpenList,MAP(NewCell.currentX,NewCell.currentY)];
Where MAP is a simple custom class.
Error Given
Code generation does not support object arrays. Function 'AStarPathPlanner ' (#394.4571.4620), line 141, column 26: "[OpenList,MAP(NewCell.currentX,NewCell.currentY)]" Launch diagnostic report.

回答 (1 件)

Krishna Adi
Krishna Adi 2021 年 1 月 20 日
The Code Generation Toolbox does not support arrays of objects.
See the link below about the features supported by the Code Generation Toolbox when using classes:
A possible workaround is to use a struct to store multiple objects based on its properties. The link below explains how to define an array of structures for code generation:

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by