A = [1.1269 -0.4940 0.1129;
1.0000 0 0;
0 1.0000 0];
B = [-0.3832;
0.5919;
0.5191];
C = [1 0 0];
Plant = ss(A,[B B],C,0,-1,'inputname',{'u' 'w'},'outputname','y');
Q = 1;
R = 1;
[kalmf,L,P,M] = kalman(Plant,Q,R);
M;
kalmf = kalmf(1,:);
a = A;
b = [B B 0*B B B 0*B B B 0*B B B 0*B B B 0*B B B 0*B B B 0*B B B 0*B B B 0*B 0*B];
c = [C;C];
d = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1];
P = ss(a,b,c,d,-1,'inputname',{'u' 'w' 'v' 'a1' 'a2' 'a3' 'a4' 'a5' 'a6' 'a7' 'a8' 'a9' 'b1' 'b2' 'b3' 'b4' 'b5' 'b6' 'b7' 'b8' 'b9' 'c1' 'c2' 'c3' 'c4' 'c5' 'c6' 'c7'},'outputname',{'y' 'yv'});
sys = parallel(P,kalmf,1,1,[],[]);
SimModel = feedback(sys,1,4,2,1);
SimModel = SimModel([1 2],[28 1 2]);
SimModel.InputName;
SimModel.OutputName;
m = cell(1,28);
t=zeros(size(m,1),size(m,2));
t=str2double(m);
src = dsp.SignalSource('SamplesPerFrame',1);
src.Signal = xlsread('D:\ieee14\trainingset.xlsx',1,'A1:AB1');
w = src.Signal;
src1 = dsp.SignalSource('SamplesPerFrame',5600);
src1.Signal = xlsread('D:\ieee14\faultset.xlsx',1,'A1:AB5601');
u = src1.Signal;
src2 = dsp.SignalSource('SamplesPerFrame',5600);
src2.Signal = xlsread('D:\ieee14\faultset.xlsx',1,'A5601:AB11201');
v = src2.Signal;
[out,x] = lsim(SimModel,[u;v;w]);
Error using DynamicSystem/lsim (line 84)
When simulating the response to a specific input signal, the input data U must be a matrix with as many rows as samples in the time
vector T, and as many columns as input channels.
Error in kalman16thapril (line 42)
[out,x] = lsim(SimModel,[w;v;u]);