I am trying to find the intersection between two planes in MATLAB.
x = -10:10;
y = x;
[X Y] = meshgrid(x,y);
Z1 = 3+X+Y;
Z2 = 4-2.*X-4.*Y;
mesh(X,Y,Z1)
hold on
mesh(X,Y,Z2)
I know I can find the locations of the elements of Z1 and Z2 where they are equal by setting a new array equal to (Z1==Z2), but that only gives me an arrays of 0s and 1s. How do I find the array containing the actual values of the line segment?