solve matlab ode system inside simulink subsystem

1 view (last 30 days)
Hi, I have a matalb ODE code, that solves a set of differential equations.
I want to put all inside a simulink subsystem, and execute the code into a Simulink project.
but I have this error:
Simulink does not have enough information to determine output sizes for this block. If you think the errors below are inaccurate, try specifying types for the block inputs and/or sizes for the block outputs.
Component:MATLAB Function | Category:Coder error
Function 'ode113' not supported for code generation.
Function 'MATLAB Function1' (#24.2038.2424), line 97, column 1:
"[t_sm,X_sm] = ode113(@(t_sm,X_sm) eq_motoTime(t_sm, X_sm, n, dh_des, S3_0, x_r, "
Launch diagnostic report.
I understood that I have to tell to simulink ho read 'ode' and my function, but I am not understanding how.
May someone help me ?
Many thanks for your time and help.
Kind Regards

Answers (1)

Sivani Pentapati
Sivani Pentapati on 6 Jan 2022
Hi Alessandro,
I think you are facing this error becuase ode113 solver does not support code generation. You can try using other solvers, ode23, ode45, ode78, ode89 which work for non stiff differential equations similar to ode113 and also support code generation. Please refer to this link for the list of functions that support code generation.

Community Treasure Hunt

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

Start Hunting!