MATLAB Answers

use the previous result of a function in the calculation

조회 수: 6(최근 30일)
Matthew Rademacher
Matthew Rademacher 2 Jul 2020
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?

  댓글 수: 0

Sign in to comment.

답변(1개)

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

  댓글 수: 0

Sign in to comment.

태그

제품


릴리스

R2017a

Translated by