Distinguishing between two surfaces

9 次查看(过去 30 天)
A
A 2014-3-21
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

回答(2 个)

Joseph Cheng
Joseph Cheng 2014-3-21
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 个评论
A
A 2014-3-22
Thanks for your response. I will try your suggestion.
What do you mean by round robin stuff?
Thanks
Image Analyst
Image Analyst 2014-3-22
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
A 2014-3-22
  1 个评论
Star Strider
Star Strider 2014-3-22
编辑:Star Strider 2014-3-22
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by