Info
此问题已关闭。 请重新打开它进行编辑或回答。
use the previous result of a function in the calculation
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!