Help with interpolation function
显示 更早的评论
I have set a monotonic function as an array as the following, with x values in the first column and y in the second;
CDF_array =
-4.0000 0
-3.0000 0.1000
-1.0000 0.4000
1.0000 0.6000
3.0000 0.9000
4.0000 1.0000
How do I interpolate to find the x-values at y=0.05, y=0.15 and y=0.63?
回答(2 个)
Star Strider
2014-4-1
With:
CDF = [ -4.0000 0
-3.0000 0.1000
-1.0000 0.4000
1.0000 0.6000
3.0000 0.9000
4.0000 1.0000];
this statement:
xi = interp1(CDF(:,2), CDF(:,1), [0.05; 0.15; 0.63])
produces:
xi =
-3.5000e+000
-2.6667e+000
1.2000e+000
the cyclist
2014-4-1
CDF_array = ...
[-4 0.0;
-3 0.1;
-1 0.4;
1 0.6;
3 0.9;
4 1.0];
y_interp = [0.05 0.15 0.63];
x_interp = interp1(CDF_array(:,2),CDF_array(:,1),y_interp)
类别
在 帮助中心 和 File Exchange 中查找有关 Interpolation 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!