Non-constant expression or empty matrix .This expression must be constant because its value determines the size or class of some expression
Mostrar comentarios más antiguos
function I am going to convert from .m to .c file using matlab coder while doing it so i am getting error in
this line of below shown code i.e fieldName = char(theFields(match))% case-sensitive field name
code :
Respuestas (1)
Walter Roberson
el 1 de Feb. de 2022
theParam = model.(fieldName);
That struct potentially have a different type for each field, so the type of theParam is not fixed, and so cannot be compiled for.
If you were to initialize theParam to a fixed size and type then possibly you could get further.
3 comentarios
Jeevan Kulal
el 1 de Feb. de 2022
Walter Roberson
el 1 de Feb. de 2022
Yes, that might work, possibly.
Jeevan Kulal
el 1 de Feb. de 2022
Editada: Jeevan Kulal
el 2 de Feb. de 2022
Categorías
Más información sobre MATLAB Coder en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!