How do I create a fit.m function to fit points from a graph to a function such as a line or curve?

조회 수: 6 (최근 30일)
How do I create a fit.m function to fit points from a graph to a function such as a line or curve?
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 11월 4일
What is the expected input? For example is the expected input a figure number and the code is expected to find line and surface and patch and contour objects and figure out how to fit them to lines or curves? Is the expected input the name of an image file that the code is expected to read in and digitize and figure out where the lines are and fit them to lines or curves?
Is there a finite list of which models to fit against? For example "polynomials of degree 1 or 2, together with negative exponential, together with single unphased gaussian" ?

댓글을 달려면 로그인하십시오.

답변 (1개)

Rishabh Mishra
Rishabh Mishra 2020년 11월 8일
Hi,
I understand that you intend to create a function that is used for curve fitting purposes. However, MATLAB supports the very robust polyfit & polyfitn functions that can serve the purpose. The ‘polyfit’ function is for curve fitting for one independent variable, while polyfitn’ supports curve fitting for multiple independent variables. Feel free to respond for any queries or clarifications.
Thanks.

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by