Matlab coder doesn't work with commands like try, { , so is there any way to fix it?

2 views (last 30 days)
I was trying to convert the Matlab function ode45 to C++ but the Matlab coder has a problem with commands { and try code generation does not support variable "yout" size growth through indexing code generation does not support cell operation for varargin and varargout
And many other commands, Is there any way to solve theses issues?

Answers (1)

sam0037
sam0037 on 24 Jun 2016
Hi
Refer to the following linkto know about Functions and Objects Supported for C and C++ Code Generation:
'ODE45' is supported for code generation with the following remarks/limitation as per the above link:
  • All odeset option arguments must be constant.
  • Does not support a constant mass matrix in the options structure. Provide a mass matrix as a function .
  • You must provide at least the two output arguments T and Y.
  • Input types must be homogeneous—all double or all single.
  • Variable-sizing support must be enabled. Requires dynamic memory allocation when tspan has two elements or you use event functions.

Community Treasure Hunt

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

Start Hunting!