Clear Filters
Clear Filters

State space model discritization inside an embedded matlab function

2 views (last 30 days)
Hi,
I am using a state space model that is linearized for a non-linear model and the equilibrium points are not specific but are determined from other (continuously changing) dynamics of the model. Hence, I am trying to form a state space model and discretize it within embedded matlab function using 'ss' and 'c2d' functions. But, I am notified with following list of errors -
"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.
Undefined function or variable 'A_p_d'. Function 'Subsystem/MATLAB Function' (#196.4343.4348), line 125, column 9: "A_p_d" Launch diagnostic report.
Undefined function or variable 'C_p_d'. Function 'Subsystem/MATLAB Function' (#196.4390.4395), line 127, column 5: "C_p_d" Launch diagnostic report.
Errors occurred during parsing of MATLAB function 'linear_model_check/Subsystem/MATLAB Function'
Simulink cannot determine sizes and/or types of the outputs for block 'linear_model_check/Subsystem/MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Simulink cannot determine sizes and/or types of the outputs for block 'linear_model_check/Subsystem/MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs."
Here A_p_d and C_p_d are the matrices I tried to determine after discritizing the continuous state space matrix.
I am using simulink 2018a. Is there a way to solve this problem? Any work around will also be appreciated where I can discretize the state space model in realtime (online).
Thank you!

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!