How to do 4-D Equivalent of 3-D surface fitting ?

2 views (last 30 days)
Maruf Hossain Anik on 20 Sep 2022
Edited: Matt J on 20 Sep 2022
I have 3 independent parameters and 1 dependent parameter. I would like to find a equation for the best fit of the data. Something similar to curve fitting but which takes 4 varriables.
For example,
Y=[3, 9, 2, -3, -3, -1, 0, 4, 3, -4, 2, 3, 3, 5, 5, -2, 6, 5, 2, 7, 4, 4, 3, 4, 8];
a=[59.76169, 48.94491, 109.2504, 41.13384, 119.1513, 128.789, 72.16298, 134.1063, 103.9212, 151.3553, 114.1976, 105.0117, 87.97976, 85.17248, 157.5749, 144.1309, 102.5106, 118.2031, 90.04979, 73.26943, 51.56135, 113.2476, 90.25419, 52.70711, 65.29004];
b=[34.03245, 62.00777, 65.26073, 35.14924, 60.43905, 13.2536, 81.35409, 42.96087, 20.11143, 51.95549, 48.69367, 103.4722, 86.34748, 36.3594, 34.22509, 29.06005, 66.28552, 50.34202, 68.52923, 13.37169, 79.57046, 16.90741, 19.23409, 10.61589, 56.88702];
c=[162.0816, 79.415, 83.82825, 27.93687, 40.62826, 82.24879, 138.5984, 90.97681, 99.80004, 67.54529, 94.40013, 122.3847, 111.1037, 73.3585, 97.30746, 122.7819, 173.2984, 123.2553, 70.9507, 124.8281, 109.5493, 107.5167, 104.1119, 100.0313, 98.01023];
How to make a equation or model which can give a output Y for input a,b,c ?

Matt J on 20 Sep 2022
Edited: Matt J on 20 Sep 2022
You can lsqcurvefit if you have Optimization Toolbox.
If not, then you might be able to use fminsearch, if you have only a small number of model parameters.

Categories

Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange

R2021a

Community Treasure Hunt

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

Start Hunting!