MATLAB: How to seperate several results, and then insert each to the new equation

insert several results

I got four results for variable x,y,z,v,and u.
[ x , y , z , v , u]
[ -3*2^(1/2), 2^(1/2)/2, -2^(1/2)/2, -1/2, 1]
[ 3*2^(1/2), -2^(1/2)/2, 2^(1/2)/2, -1/2, 1]
[ -3*2^(1/2), -2^(1/2)/2, -2^(1/2)/2, 1/2, 1]
[ 3*2^(1/2), 2^(1/2)/2, 2^(1/2)/2, 1/2, 1]
I want to insert each result into an equation "d"
d = 8*u*x*y^2*z - 8*y*z^3 - 8*x*y^2*z - 8*v*y^2*z^2 - 8*v*z^4
Therefore, I want four different numeric "d"s.
Below is my full commands:
clc
clear
syms x y z v u
lx=z-u*z==0
ly=z-2*y*v==0
lz=x+y-2*z*v-x*u==0
lv=1-y^2-z^2==0
lu=3-x*z==0
sol = solve([lx,ly,lz,lv,lu], [x, y, z,v,u])
[sol.x, sol.y, sol.z, sol.v, sol.u]
A=[0 0 0 2*y 2*z; 0 0 z 0 x; 0 z 0 0 1-u; 2*y 0 0 -2*v 1; 2*z x 1-u 1 -2*v]
d=det(A)
subs(d)

Best Answer

subs(d,{x,y,z,v,u},{sol.x,sol.y,sol.z,sol.v,sol.u})
Related Question