Distinguishing between two surfaces
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (2)
Joseph Cheng
le 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 commentaires
Image Analyst
le 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
le 22 Mar 2014
1 commentaire
Star Strider
le 22 Mar 2014
Modifié(e) : Star Strider
le 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.
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!