0

I want to make a contour plot of some data I get from a program.

I get three matrices: X , Y and Z

contourf(X,Y,Z)

These matrices are of equal size. The matrices X and Y are not constructed using a meshgrid and are generally unsorted.

My plot shows some strange features that I don't expect. Therefore, I think Matlab is not able to plot using unsorted mesh points.

How can I plot this data? Or how can I sort the data?

Rene
  • 41
  • 4
  • 1
    Have you considered interpolating your data in an uniform grid? Unforunatly we cant help more because we cant see the data nor the plot........... – Ander Biguri Mar 02 '16 at 12:56
  • Your data describes a regular mesh? So every combination of x and y values is present? – Daniel Mar 02 '16 at 13:10
  • See this link: http://stackoverflow.com/a/35571055/2562693 I think you wanna do the same thing. – R.Falque Mar 02 '16 at 13:12
  • Basically, I have a matrix with x coordinates and a matrix with y coordinates. These coordinates are sort of random. A matrix Z contains the z value, which can be represented in a contourf plot. The data does not describe a regular mesh. I just tried to interpolate, but it didn't turn out correct. I think now that Matlab is capable of plotting scattered data and my data is the problem. The areas that showed strange features had little datapoints in it, so the plot interpolated at this point and created the features. – Rene Mar 02 '16 at 13:16
  • A 5x5 sample of your data would help. – R.Falque Mar 02 '16 at 13:30

0 Answers0