Distinguishing between two surfaces

조회 수: 16 (최근 30일)
A
A 2014년 3월 21일
댓글: Image Analyst 2014년 3월 22일
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