필터 지우기
필터 지우기

Curve Fitting - X &Y data

조회 수: 2 (최근 30일)
Abraham
Abraham 2018년 11월 16일
댓글: Abraham 2018년 11월 17일
I have x and y. Image attached
How can I do at least three different curve fits that are appropriate for the data?
data no noise.PNG
  댓글 수: 1
dpb
dpb 2018년 11월 16일
Start by plotting...sounds like homework???

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

채택된 답변

KSSV
KSSV 2018년 11월 17일
Take this as a demo example. In T and mu, you have to enter your data. Read about plot and polyfit.
T = linspace(0,4*pi,10);
mu = sin(T);
% Use polyfit to fit polynomial to the points.
T1 = linspace(min(T),max(T));
figure
hold on
plot(T,mu)
for n = 1:3
p = polyfit(T,mu,n);
% Evaluate the polynomial on a finer grid and plot the results.
mu1 = polyval(p,T1);
plot(T1,mu1)
end
legend({'Original','n = 1 fit','n = 3 fit','n = 3 fit',})
  댓글 수: 1
Abraham
Abraham 2018년 11월 17일
Thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fit Postprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by