Interpolation

조회 수: 4 (최근 30일)
Giulia De Luca
Giulia De Luca 2011년 4월 20일
답변: Rahul R 2022년 9월 12일
Dear all, I have a problem with the output of a simulation. I have used PSpice to simulate a device and I am trying to use data in Matlab, but the sampling of data is not what I need. I have an x-y graph and I would like to know the value of my simulation every 0.01 ns, but by now I know it more or less every 0.1 ns and the frequency of sampling is not constant. Is it possible to solve my problem? I tryed whit polyfit and polyval, but they did not work. Thank you.

채택된 답변

Arnaud Miege
Arnaud Miege 2011년 4월 20일
You probably need to use interp1. If you can post your code, I can maybe be more specific.
HTH,
Arnaud

추가 답변 (3개)

John D'Errico
John D'Errico 2011년 4월 20일
Of course polyfit fails to interpolate, as it is not a tool for interpolation!
Use interp1, or spline/pchip coupled with ppval if the data represents a function to be interpolated. If you have noise in the data, then you may wish to smooth the noise. But then you are not interpolating again! Even then however, polyfit is rarely a good choice.
If your data is from a multi-valued relationship that will not yield a single value y for any given x, then you need to do otherwise. There are other tools that may be appropriate, depending on the problem.

Giulia De Luca
Giulia De Luca 2011년 4월 20일
Arnaud and John, thank you very much for your suggestions. I have just solved my problem with a for cicle and interp1.

Rahul R
Rahul R 2022년 9월 12일
syms y(x) E l w
dsolve(E*l*diff(y, 2) == (w*xˆ2/2)-w*l*x, y(0) == 0,y(2*l) == 0)
max_deflection=subs(ans,x,l)
ans =
(x*(8*w*lˆ3 - 4*w*l*xˆ2 + w*xˆ3))/(24*E*l)
max_deflection =
(5*lˆ3*w)/(24*E)

카테고리

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