quadratic curve from matrices determinant
Hello everyone,
could someone help me please?
I would like to obtain the quadratic curve coming from the calculation of a 2×2 matrix determinant.
This is what I wrote in my code:
h = @(x,y,z) 3.*(x+5).^2 + (x + 5).*(y – 2) + (y – 2).^2;
syms x y z
w = h(x,y,z)
g = @(x,y,z) (x – 5).^2 – (x – 5).*(y – 3) + (y – 3).^2;
syms x y z
w1 = g(x,y,z)
Dhx = diff(h,x)
Dhy = diff(h,y)
Dgx = diff(h,x)
Dgy = diff(h,y)
p1 = Dhx * Dgy
expand(p1)
p2 = Dhx * Dgy
expand(p2)
exp1 = expand(p1)
exp2 = expand(p2)
Now I should do the difference between exp1 and exp2, but I can’t do it.
I am new with the symbolic toolbox, so I have difficulties to pass from symbolic expressions to numerical values.
I guess there is a faster way to calculate the determinant of my matrix and thus get the quadratic function but I don’t really know how to find it.
Thank you very much for your support!
LauraHello everyone,
could someone help me please?
I would like to obtain the quadratic curve coming from the calculation of a 2×2 matrix determinant.
This is what I wrote in my code:
h = @(x,y,z) 3.*(x+5).^2 + (x + 5).*(y – 2) + (y – 2).^2;
syms x y z
w = h(x,y,z)
g = @(x,y,z) (x – 5).^2 – (x – 5).*(y – 3) + (y – 3).^2;
syms x y z
w1 = g(x,y,z)
Dhx = diff(h,x)
Dhy = diff(h,y)
Dgx = diff(h,x)
Dgy = diff(h,y)
p1 = Dhx * Dgy
expand(p1)
p2 = Dhx * Dgy
expand(p2)
exp1 = expand(p1)
exp2 = expand(p2)
Now I should do the difference between exp1 and exp2, but I can’t do it.
I am new with the symbolic toolbox, so I have difficulties to pass from symbolic expressions to numerical values.
I guess there is a faster way to calculate the determinant of my matrix and thus get the quadratic function but I don’t really know how to find it.
Thank you very much for your support!
Laura Hello everyone,
could someone help me please?
I would like to obtain the quadratic curve coming from the calculation of a 2×2 matrix determinant.
This is what I wrote in my code:
h = @(x,y,z) 3.*(x+5).^2 + (x + 5).*(y – 2) + (y – 2).^2;
syms x y z
w = h(x,y,z)
g = @(x,y,z) (x – 5).^2 – (x – 5).*(y – 3) + (y – 3).^2;
syms x y z
w1 = g(x,y,z)
Dhx = diff(h,x)
Dhy = diff(h,y)
Dgx = diff(h,x)
Dgy = diff(h,y)
p1 = Dhx * Dgy
expand(p1)
p2 = Dhx * Dgy
expand(p2)
exp1 = expand(p1)
exp2 = expand(p2)
Now I should do the difference between exp1 and exp2, but I can’t do it.
I am new with the symbolic toolbox, so I have difficulties to pass from symbolic expressions to numerical values.
I guess there is a faster way to calculate the determinant of my matrix and thus get the quadratic function but I don’t really know how to find it.
Thank you very much for your support!
Laura symbolic, determinant, quadratic function MATLAB Answers — New Questions