title: Creating standalone butter filter with Matlab coder
body: <p>i'm trying to compile with Matlab Coder a custom function which includes a butterworth filter.
  I've extracted the lines that give me problem with the Matlab coder function.</p>
  
  <pre><code>function [output] = myfilter(input,fs) %#codegen
  f1 = 5;         % cuttoff low frequency to get rid of baseline wander
  Wn = f1.*2./fs;   % cutt off based on fs
  N  = 3;         % order of 3 less processing
  [a,b] = butter(N,Wn); % bandpass filtering
  output = filtfilt(a,b,input); % filtering
  output = output/max(abs(output));
  </code></pre>
  
  <p>I'm getting an error when I launch the command to compile it:</p>
  
  <p><code>codegen -config:lib -launchreport myfilter -args {zeros(1,100),10}</code></p>
  
  <p>The output error is: <strong>All inputs must be constant.</strong>
  I tried to use the function coder.const modifying the code as follows, but still have the same problem:</p>
  
  <pre><code>function [output] = myfilter(input,fs) %#codegen
  f1 = 5;         % cuttoff low frequency to get rid of baseline wander
  Wn = f1.*2./fs;   % cutt off based on fs
  N  = 3;         % order of 3 less processing
  [a,b] = coder.const(@butter,N,Wn); % bandpass filtering
  a = coder.const(a);
  b = coder.const(b);
  output = filtfilt(a,b,input); % filtering
  output = output/max(abs(output));
  </code></pre>
  
  <p>Can somebody help me with this issue? I'm new to Matlab Coder. Thanks in advance!</p>