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
Solution Comments
Show comments
Loading...
Problem Recent Solvers46
Suggested Problems
-
Maximum running product for a string of numbers
2253 Solvers
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1991 Solvers
-
Project Euler: Problem 4, Palindromic numbers
1266 Solvers
-
Convert a numerical matrix into a cell array of strings
2383 Solvers
-
1709 Solvers
More from this Author99
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The test suite does not allow for roundoff error.
good point, fixed, thanks