Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Can someone please explain me the code and how can i give my input in it?

2 vues (au cours des 30 derniers jours)
Nana Fernandes
Nana Fernandes le 12 Avr 2017
Clôturé : MATLAB Answer Bot le 20 Août 2021
I want a kalman filter with two inputs and one output port; 1st Input is a excel sheet with 16801x28 and 2nd is a sample of which i want to see how close are the values to the original which again is a excel sheet of 6rows and 28 columns. Can someone please explain the code given below and tell me where can i input my two excel sheet inputs Thanks in advance
numSamples = 4000;
R = 0.02;
src = dsp.SignalSource;
src.Signal = [ones(numSamples/4,1); -3*ones(numSamples/4,1);...
4*ones(numSamples/4,1); -0.5*ones(numSamples/4,1)];
tScope = dsp.TimeScope('NumInputPorts', 3, 'TimeSpan', numSamples, ...
'TimeUnits', 'Seconds', 'YLimits',[-5 5], ...
'ShowLegend', true); % Create the Time Scope
kalman = dsp.KalmanFilter('ProcessNoiseCovariance', 0.0001,...
'MeasurementNoiseCovariance', R,...
'InitialStateEstimate', 5,...
'InitialErrorCovarianceEstimate', 1,...
'ControlInputPort',false); %Create Kalman filter
while(~isDone(src))
trueVal = src();
noisyVal = trueVal + sqrt(R)*randn;
estVal = kalman(noisyVal);
tScope(noisyVal,trueVal,estVal);
end

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by