필터 지우기
필터 지우기

Error when using inv on system identification object

조회 수: 14 (최근 30일)
Lars Wadsö
Lars Wadsö 2023년 8월 14일
댓글: Lars Wadsö 2023년 8월 23일
In the code below an ARX410 model is created with iddata and arx and some random data. When I try to invert the model I get the following error message: "Error using inv. Invalid data type. Input matrix must be double or single". What is the problem?
Ts=1;t=(0:100)'; %time
u=sqrt(t/300); %in-data
y=sqrt(t/600)+randn(size(t))/50; %out-data
figure(1);clf;hold on;plot(t,u,'.',t,y,'.');hold off %plotting u and y
S=iddata(y,u,Ts); %generate a data object
sys=arx(S,[4 1 0]); %generate a model object
invsys=inv(sys); %invert the model

답변 (1개)

Tianyu
Tianyu 2023년 8월 20일
Hi Lars,
I suspect that you do not have correct "inv" function on the path. When you type
>> which -all inv
in the command line, you should be able to find the following function on the path
MATLAB\R2023a\toolbox\shared\controllib\engine\+ltipack\@ssdata\inv.m
this is the "inv" function used to invert the model.
Manually add it should resolve the issue.
  댓글 수: 1
Lars Wadsö
Lars Wadsö 2023년 8월 23일
Thanks. That solved my problem (I had recently installed a new version of MATLAB and the paths were not set correctly)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Model Identification에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by