Why do I get an assertion failed error when I try to set the input argument types in a project using MATLAB Coder 2.2 (R2012a)?

7 visualizaciones (últimos 30 días)
I am trying to define data types for input arguments to my entry-point function using ‘Define by example’ or by using the ‘Autodefine types’ option. Either way I get an error message similar to:
Type conversion failed at <SNIP> Assertion failed.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 7 de Ag. de 2012
The error is caused when the examples used to define the data type are not valid. A scalar [1x1] structure whose fields are not scalar is invalid. For example, the following [1x1] structure ‘testStruct’ cannot be used to define arguments for code generation as the field ‘fieldB’ is not scalar.
testStruct =
fieldA: 0
fieldB: [21x1 struct]
The workaround is to instead use an array of structures.

Más respuestas (0)

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2012a

Community Treasure Hunt

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

Start Hunting!

Translated by