필터 지우기
필터 지우기

How can I use fminsearch() to apply a sinc function (sin(x)/x) fit on my data?

조회 수: 5 (최근 30일)
Asser Abdelgawad
Asser Abdelgawad 2022년 6월 20일
편집: Sam Chak 2022년 6월 20일
I am aware that fminsearch can be used to achieve this, but it is not intuitive to me how it can be done. Can someone provide an example? T

답변 (1개)

Sam Chak
Sam Chak 2022년 6월 20일
편집: Sam Chak 2022년 6월 20일
How about considering the nonlinear least-squares curve fitting lsqnonlin?
fun = @(p) p(1)*sinc(p(2)*(xdata - p(3))) - ydata;
p0 = [p1, p2, p3];
p = lsqnonlin(fun, p0)
plot(xdata, ydata, 'r-', xdata, p(1)*sinc(p(2)*(xdata - p(3))), 'b-')

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by