How to put limit on coefficient produced by polyfit in MATLAB?

Hello,
So what I am trying to do is plot some experimental data along with a second order polynomial fit (Ax^2 + Bx + C), the coefficients of which are determined using polyfit. The problem I am having is that I do not want the first term, in this case A to be negative. Is there any way I can put constraints on this A term so that it does not go below zero?
Any help would be appreciated.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Preguntada:

el 31 de Jul. de 2013

Editada:

el 20 de Feb. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by