Function 'ss' implicitly resolved in the MATLAB workspace. Implicit evaluation in MATLAB is not supported. Please declare this function extrinsic using eml.extrinsic('ss'), or call it using feval.

2 views (last 30 days)
When I use my matlab code in embedded matlab function block in simulink it shows the following error
"Function 'ss' implicitly resolved in the MATLAB workspace. Implicit evaluation in MATLAB is not supported. Please declare this function extrinsic using eml.extrinsic('ss'), or call it using feval.
Function 'Embedded MATLAB Function' (#43.1890.1907), line 104, column 12: "ss(Ae, Be, He, D)" Launch diagnostic report."
How can I solve it?

Answers (1)

C.J. Harris
C.J. Harris on 20 May 2013
What this error message is saying is that in order to use the state space function (ss) Simulink has to call the MATLAB workspace. As the error message states you can get around this by declaring the function extrinsic, for example:
function y = fcn(u)
eml.extrinsic('ss')
% Code here
y = u;
The main restriction this will have (in addition to the computational time) is you will no longer be able to generate code (C/C++) from the Simulink model using Real-Time Workshop due to the dependencies on core MATLAB functionality.
A better solution would be to use the state space blocks provided as part of the standard Simulink library (Simulink/Continuous or Simulink/Discrete) to construct your state space model.
  1 Comment
Syed Ahmad Nadeem
Syed Ahmad Nadeem on 11 Jun 2020
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 an 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." I am using simulink 2018a. Is there a way to solve this problem? Any work around will also be appreciated.
Thank you!

Sign in to comment.

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!