kalman filter in matlab

1 次查看(过去 30 天)
Nana Fernandes
Nana Fernandes 2017-4-14
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];
c = [C;C];
d = [0 0 0;0 0 1];
P = ss(a,b,c,d,-1,'inputname',{'u' 'w' 'v'},'outputname',{'y' 'yv'});
sys = parallel(P,kalmf,1,1,[],[]);
SimModel = feedback(sys,1,4,2,1); % Close loop around input #4 and output #2
SimModel = SimModel([1 3],[1 2 3]); % Delete yv from I/O list
SimModel.InputName
SimModel.OutputName
src = dsp.SignalSource(xlsread('D:\ieee14\faultset.xlsx',1,'A5601:AB11201'));
u = src;
src1 = dsp.SignalSource(xlsread('D:\ieee14\faultset.xlsx',1,'A1:AB5600'));
w = src1;
src2 = dsp.SignalSource(xlsread('D:\ieee14\trainingset.xlsx',1,'A1:AB6'));
v = src2;
[out,x] = lsim(SimModel,[w,v,u]);
This is my code and im getting the following error
Error using dsp.SignalSource/horzcat
Array formation and parentheses-style indexing with objects of class 'dsp.SignalSource' is not
allowed. Use objects of class 'dsp.SignalSource' only as scalars or use a cell array.
Error in kalman15thapril (line 32)
[out,x] = lsim(SimModel,[w,v,u]);
Please help me out with this error Thanks in advance

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Code Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by