Dear community,
I have two matrices which are:
x = [0,3e-5, 7e-5, 2e-4, 6e-4, 0.002, 0.006, 0.01, 0.02, 0.03, 0.05, 0.07];
y = [1.1195e6, 1.1195e+06, 1.1195e+06, 1.1195e+06, 1.1195e+06, 1.1194e+06,1.1192e+06, 1.1190e+06, 1.1184e+06, 1.1177e+06, 1.1161e+06, 1.1141e+06];
My question is how can I interpolate my data? and how can I find this function?
Thanks in advance.

 채택된 답변

Mohammad Abouali
Mohammad Abouali 2014년 12월 9일

0 개 추천

Use interp1(). this seems the most appropriate one for your data set.

댓글 수: 1

Mohammad Abouali
Mohammad Abouali 2014년 12월 9일
편집: Mohammad Abouali 2014년 12월 9일
Question by Moj: For example I want to know the value of y for x = 4e-5. How can I find this?
Answer
y_interpolated=interp1(x,y,4e-5);
y_interpolated would have the interpolated value at x=4e-5;
if you want spline interpolation you can define the method:
y_interpolated=interp1(x,y,4e-5,'spline');

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

추가 답변 (1개)

matlabuser12
matlabuser12 2014년 12월 9일

0 개 추천

what do you mean by interpolate this data and find a function? Do you mean fit a curve to this and find the function? interpolation means finding data points within your set that arent there based on the data around that point.

댓글 수: 1

Moj
Moj 2014년 12월 9일
For example I want to know the value of y for x = 4e-5. How can I find this?

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

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

질문:

Moj
2014년 12월 9일

편집:

2014년 12월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by