how to solve the problem with extrinsic error here?

4 ビュー (過去 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 Center および File ExchangeSignal Attributes and Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by