title: How to implement a feedback loop in Matlab?
body: <p>Consider a block scheme where there is a feedback path and the feedback signal is filtered by some kind of filter.</p>
  
  <p>How can I implement this in Matlab (not Simulink)? My doubt is particularly about the filter: what interval of the signal should I choose to perform the filter?</p>
  
  <p>For example if the filter has <code>n</code> coefficients, is it enough to filter the interval of the signal from <code>i_n</code> to <code>i</code> where <code>i</code> is the current iteration step?</p>
  
  <p>I would like to replicate the behaviour of Simulink for the feedback loop but I found there is no way to export a simulink model to a Matlab script.</p>