use the previous result of a function in the calculation

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?

답변 (1개)

David Goodmanson
David Goodmanson 2020년 7월 2일
편집: David Goodmanson 2020년 7월 2일
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.

이 질문은 마감되었습니다.

제품

릴리스

R2017a

태그

질문:

2020년 7월 2일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by