필터 지우기
필터 지우기

turn plot into a polyfit or polyval

조회 수: 2 (최근 30일)
rockstar49
rockstar49 2022년 9월 7일
답변: Cris LaPierre 2022년 9월 7일
Like to make this into polyval or polyfit so the points smooth out any noise
tried to use code, but seems it does not like taking a polyval of a FRF.
Any suggestions would help!
  댓글 수: 1
dpb
dpb 2022년 9월 7일
I presume FRF must be "Frequency Response Function", but how was it computed/where did it come from?
But, the problem in the above code is you've commented out the polyfit that is needed to compute a set of coefficients to pass to polyval and then just tried to use polyval on the x,y values of the to-be-fitted data instead.
The commented-out polyval line would be somewhat closer if hadn't commented out the polyfit, but it would then need to be
q=polyfit(f,abs(FRF),7);
z=polyval(q,f);
However, I'll note that a high-order polynomial such as this is highly unlikely to be satisfactory solution to the problem; you'll be wanting to look at some smoothing algorithm instead. Just what might be most appropriate would depend on what the actual data looks like which we do not have available to us.

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2022년 9월 7일
In your figure window, select Tools > Basic Fitting
Use the UI to find an appropriate fit to your data. Once done, export the results to the workspace.

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

태그

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by