Problem 486. Surface Fit z(x,y)
Given three vectors x,y,z. Find four coefficients c = [cxx cxy cyy c00], such that z = cxx*x.^2+cxy*x.*y+cyy*y.^2+c00.
For example,
x = [ 0 0 1 1 2 2 3 3] y = [ 0 1 0 1 0 1 0 1] z = [-4 -1 -3 -2 0 -1 5 2]
then
z = x.^2-2*x.*y+3*y.^2-4
and
c = [cxx cxy cyy c00] = [1 -2 3 -4]
Solution Stats
Problem Comments
-
2 Comments
Tim
on 12 Mar 2012
The test suite does not allow for roundoff error.
AMITAVA BISWAS
on 12 Mar 2012
good point, fixed, thanks
Solution Comments
Show commentsProblem Recent Solvers43
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15151 Solvers
-
2548 Solvers
-
Find the "ordinary" or Euclidean distance between A and Z
158 Solvers
-
Flag largest magnitude swings as they occur
661 Solvers
-
Determine the number of odd integers in a vector
649 Solvers
More from this Author100
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!