Distinguishing between two surfaces
3 views (last 30 days)
Show older comments
Hi guys,
I have a simple question. I want to distinguish between two surfaces with x, y, and z values. The equations resemble like the ones here:
z = x + y; z = 2x + y;
I basically want to find out when z is different with the same values for x and y. I then want to be able to graph this 'difference'. Is it a simple thing to do? Is it as simple as subtracting the two equations?
If this is possible, then is it possible to do something similar with 3 or more surfaces with similar equations? I want to find x and y values where z is different for all equations.
I hope this makes sense.
Thank you
0 Comments
Answers (2)
Joseph Cheng
on 21 Mar 2014
I would first call the two z something different that way you don't override the other z. Yes a simple subtraction would be something you could do and then you can use the surf(x,y,z1-z2) to show the difference. to find the the points that are different for the same x and y values, the find() function for when z1-z2~=0 (z1 subtract z2 does not equal 0) will give you the index of values not equal zero. when you introduce 3+ surfaces you can use the same find but you'll have to do some round robin comparison scheme and display it.
2 Comments
Image Analyst
on 22 Mar 2014
He means generate the 2 z's for every possible x,y coordinate. If not in a nice evenly spaces matrix (which is probably preferable), then at least such that z1 and z2 have values for the same pairs of (x,y) coordinates.
A
on 22 Mar 2014
1 Comment
Star Strider
on 22 Mar 2014
Edited: Star Strider
on 22 Mar 2014
‘ C = setdiff(A,B) returns the data in A that is not in B. ’
The setdiff function looks for the numbers that two arrays do not share. It will not do point-by-point comparisons.
I believe Joseph meant ‘round robin comparison scheme’ to be (z1 - z2), (z3 - z1), (z3 - z2), etc. in the event you have more than two surfaces you want to compare. You would probably have to plot the (z1 - z2), (z3 - z1), (z3 - z2) surfaces each in a different plot.
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!