Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

use the previous result of a function in the calculation

1 Ansicht (letzte 30 Tage)
Matthew Rademacher
Matthew Rademacher am 2 Jul. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I want to perform a calculation: , how can I include the Y(i-1) part? Obviously a loop would work, but my data set is quite large so a loop takes a while to execute.
Is there a better way?

Antworten (1)

David Goodmanson
David Goodmanson am 2 Jul. 2020
Bearbeitet: David Goodmanson am 2 Jul. 2020
Hi Matthew,
there is definitely a better way.
Y = filter(B,[1 -A],X)
Here the assumption is that X is an input vector and B is a scalar constant. See help for filter for the input conventions.

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by