contour plot not working because of duplicate value
Show older comments
Hello Everybody
I have 3 vectors with 95000 rows. X, Y,and T(time of rupture). Now I need to draw contour using these 3 vectors.but it sounds there are duplicates data(an error message say so! I guess there might be some data with same X and Y ) . I would like to removes them before drawing contour plot. Can anyone help. Thank You for your time.
Answers (1)
Varun Garg
on 4 Jun 2018
Hi Samaneh,
My understanding of your question is that for the vectors X and Y you want to find values which are common in both.
For that you can use
intersect
Example snippet:
x=[1 2 3 4 5 10 20 30];
y=[4 5 10 100 90 22 33];
[z ix iy]= intersect(x,y)
x(ix)=[]
y(iy)=[]
11 Comments
Samaneh Arzpeima
on 4 Jun 2018
Edited: Samaneh Arzpeima
on 4 Jun 2018
Varun Garg
on 4 Jun 2018
I am trying to imagine it. So basically X and Y are vectors only but they make up a coordinate system with let's say X(1) and X(1) correspond to a point in 2-d plane?
Samaneh Arzpeima
on 4 Jun 2018
Edited: Samaneh Arzpeima
on 5 Jun 2018
Varun Garg
on 5 Jun 2018
So what I gather from the information provided is that the mesh can be though of as an AxB matrix let's say M. And if there is a point X(i),Y(i) which can be thought of as M(j,k), if both of the coordinates are same, you want to remover the whole row j?
Samaneh Arzpeima
on 5 Jun 2018
Edited: Samaneh Arzpeima
on 5 Jun 2018
Samaneh Arzpeima
on 5 Jun 2018
Varun Garg
on 5 Jun 2018
It has become a bit confusing. Let me tell you final understanding of your question:
Mathematically, you have a function
f(x,y,t).
And let's say you have two points on the 3-D Plane
f(xi,yi,ti) and f(xj,yj,tj).
If
f(xi,yi,ti) == f(xj,yj,tj)
you want to remove either
f(xi,yi,ti) or f(xj,yj,tj).
Is that so?
Samaneh Arzpeima
on 5 Jun 2018
Samaneh Arzpeima
on 5 Jun 2018
Varun Garg
on 5 Jun 2018
Okay. That's a bit better explanation. One more doubt If
X(i,1)=X(j,1)=X(k,1)
and
Y(i,1)=Y(j,1)=Y(k,1)
Should they both hold true together for me to keep only i row and delete j,k.. Or any of (1) or (2) hold true, I should delete j,k.. from both X and Y?
Samaneh Arzpeima
on 6 Jun 2018
Categories
Find more on Graphics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!