MATLAB Answers

I am trying to interpolate data from a data set. each data point depends on two variables. I wish to interpolate data inbetween them but not sure which function to use.

1 view (last 30 days)
Tania Hari Madhavi
Tania Hari Madhavi on 9 Sep 2020
Commented: Alex Sha on 21 Sep 2020
X(variable 1) ranges between 0 to 30.69 and Y (variable 2) has two values 0.06 and 0.015. corrresponding values of the function depdendant on x and y are given in matrix format below. I wish to interpolate points for the X values when the corresponding Y value is 0.03(between 0.06 and 0.015)
6.00E-02 1.50E-02
0 0 0
1 19.7627 44.421
2 20.4254 46.964
3 21.0881 49.507
4 21.7508 52.05
5.02656 21.52675 54.66054
7.495802 23.79959 60.93982
10.07348 25.82133 67.49487
12.57828 27.59128 73.86457
15.08343 29.61274 80.23518
17.6245 31.38282 86.6971
20.05641 32.90098 92.88145
22.77898 34.7975 99.80494
25.13765 35.81236 105.803
27.85968 37.3316 112.7252
30.18262 38.7236 118.6324
30.69034 38.72549 119.9235

  3 Comments

Alex Sha
Alex Sha on 21 Sep 2020
Hi, Tania, using the fitting function below for your data:
z = ((1+p1*x+p2*y)/(p3+p4*x+p5*y))*x^p6;
Root of Mean Square Error (RMSE): 0.289317492463695
Sum of Squared Residual: 2.84595678914633
Correlation Coef. (R): 0.999961722670218
R-Square: 0.999923446805589
Parameter Best Estimate
---------- -------------
p1 0.0789662121293465
p2 22.3733549538477
p3 0.00158106317969181
p4 -2.06920975585446E-6
p5 2.02328157880142
p6 0.00480045399978579
When y=0.03, the corresponded z will be:
0
28.1027419119399
29.4695871486962
30.8027482616138
32.1229094712084
33.4712089275956
36.7002709522503
40.0613990097622
43.3235655146164
46.5845879608778
49.8918606433028
53.0571541956126
56.6012692450567
59.6723118101152
63.2173415594977
66.2434433614816
66.904958155618

Sign in to comment.

Answers (1)

Vinai Datta Thatiparthi
Vinai Datta Thatiparthi on 16 Sep 2020
Hey Tania,
Since you have 2 independent variables, the scenario that you describe seems to be a curve-fitting problem. Based on the knowledge of what 'X' & 'Y' represent, you may have to estimate the relationship between the output data (F(x,y)) and the 2 input independent variables (X & Y). Once you get the relationship, you could then use that to evaluate F(x,0.03). Note that in theory, there could be multiple curves that could pass through the given set of points.
These following links may have the information needed to establish the relationship:
Hope this helps!

Community Treasure Hunt

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

Start Hunting!