title: Polynomial fit matlab with some constraints on the coefficients
body: <p>I have data that I should interpolate with a function which must be of the following kind:</p>
  
  <blockquote>
    <p><code>f(x) = ax<sup>4</sup> + bx<sup>2</sup> + c</code></p>
  </blockquote>
  
  <p>with <code>a > 0</code> and <code>b ≤ 0</code>. Unfortunately, MATLAB's <a href="http://www.mathworks.com/help/matlab/ref/polyfit.html"><code>polyfit</code></a> does not allow any constraints on the coefficients of the polynomial. Does anybody know if there is a MATLAB function to do this? Otherwise, how can I implement it?</p>
  
  <p>Thank you very much in advance,</p>
  
  <p>Elisabetta</p>