필터 지우기
필터 지우기

smooth line of semilog plot

조회 수: 6 (최근 30일)
Pichawut Manopkawee
Pichawut Manopkawee 2017년 9월 30일
답변: Star Strider 2017년 9월 30일
Hi all,
Is there any effective and easy-understandable way to make a smoothly best-fitted line to the data on semilogx plot? The plot with spline seems to be effective way, however, it is uneasy to understand for me. Could somebody guide me to know how to smooth the semilogx plot? My data are
x = [5 15 25 35 45 55 65 75 85 95 105 135 155 165];
y = [0 0 7.5 30 47.5 62.5 75 85 90 92.5 95 97.5 100 100];
plot this with the semilogx and find the smooth curve fitting them through.
Thank you so much.

채택된 답변

Star Strider
Star Strider 2017년 9월 30일
Your data appear to be able to be modeled by a Logistic function (link).
I would simply do the fit:
x = [5 15 25 35 45 55 65 75 85 95 105 135 155 165];
y = [0 0 7.5 30 47.5 62.5 75 85 90 92.5 95 97.5 100 100];
logistic_fcn = @(b,x) b(1) ./ (1 + exp(-b(2).*(x-b(3))));
NRCF = @(b) norm(y - logistic_fcn(b,x));
B = fminsearch(NRCF, [100; 0.1; 50]);
xi = linspace(min(x), max(x));
yi = logistic_fcn(B,xi);
figure(1)
semilogx(x, y, 'pg')
hold on
plot(xi, yi)
hold off
grid

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by