Polyfit with Some Coefficients Fixed

22 ビュー (過去 30 日間)
Saeid
Saeid 2018 年 10 月 19 日
回答済み: Torsten 2018 年 10 月 19 日
I want to fit a set of data using polyfit, but I want certain coefficients to have fixed values. E.g., if the data is to be fitted to a second order polynomial,
y(x)=ax^2+bx+c
I want c to always be equal to zero. Is it possible to define constraints on the polyfit or should I just move on to the Curve Fitting Toolbox?

回答 (1 件)

Torsten
Torsten 2018 年 10 月 19 日
For the case you describe, you can use "polyfitn":
https://de.mathworks.com/matlabcentral/fileexchange/34765-polyfitn
Best wishes
Torsten.

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by