Problem with idnlgrey function error

2 次查看(过去 30 天)
si heon Seong
si heon Seong 2021-1-30
评论: Rik 2021-1-30
Good day, I'm a Matlab beginner
I'm trying to use matlab to estimate my experimental data with some model with the function named idnlgrey with this example : https://kr.mathworks.com/help/ident/ug/represent-nonlinear-dynamics-using-matlab-file-for-grey-box-estimation.html
I made the model named Threelevelmodel.m
function [dx, y] = Threelevelmodel(t,x,u,k1,k3,k13,k31,varargin)
y = [x(1); x(2)];
dx = [(-k3-k31)*x(1)+k13*x(2); k31*x(1)+(-k1-k13)*x(2)];
And I saved this file,
Then the main code
FileName = 'Threelevelmodel';
Order = [2 0 2]; % [ny nu nx]
Parameters = [0.011; 0.011; 0.09; 0.147]; % Initial parameters
InitialStates = [5640000000; 42500000]; % Initial states
Ts = 0; % Time-continuous system
nlgr = idnlgrey(FileName, Order, Parameters, InitialStates, Ts);
When I tried this code, I got the error like
함수 'idnlgrey'은(는) 'char'형 입력 인수에 대해 정의되지 않았습니다.
It says that the function 'idnlgrey' is not defined for the input argument 'char'
However, no matter how hard I read the matlab description of idnlgrey, the 'Filename' must contain a char variable
How can I solve it? Thank you
  1 个评论
Rik
Rik 2021-1-30
This time I edited your question for you. Next time, please use the tools explained on this page to make your question more readable.
In general that error message means that you don't have the function. Did you make sure you have installed the System Identification Toolbox?

请先登录,再进行评论。

回答(0 个)

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!