how to solve the problem with extrinsic error here?

조회 수: 3 (최근 30일)
tret retret
tret retret 2020년 1월 13일
댓글: tret retret 2020년 1월 13일
Hello,
Get an following error message by using this code.
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
Expected either a logical, char, int, fi, single, or double. Found an mxArray. MxArrays are returned from calls to the MATLAB interpreter and are not supported inside expressions. They may only be used on the right-hand side of assignments and as arguments to extrinsic functions.
function x= fcn(u, y,A1,L1,b,C)
coder.extrinsic('evalin')
coder.extrinsic('evalin')
coder.extrinsic('sscanf')
coder.extrinsic('fgets')
fileID = fopen("result.txt", "r");
file = fgets(fileID)
value = sscanf(file, '%g', [1,2]) %
x1 = value(1,1)
x2 = value(1,2)
value=double([x1;x2])
if value(1,1) < 1
x3=[10;20];
end
x_predicted=A1*x3+b*u
x_est1=x_predicted+L1*(y-C'*x_predicted)%Filterung
x3 = x_est1
x_est = x_est1;
What is the problem here?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Attributes and Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by