0

Can contour work to create grid contour? My data is like the first picture. I want to create graph like

(1) x y are column 1 and column 2 as the grid coordinate

(2) column 3 is the costs "Z". In applications, column 3 is the distance.

I can do this according to a MxN matrix with the average distance of M to N. But the generated graph only shows an average contour. I wanna try to generate more detailed or mesh one like the second graph. Did i try the right function or there is other more suitable one than contour()? Thank you!

Code example:

D0o(3,4) = sum(A34_0o(:,3))/100;
D0o(3,5) = sum(A35_0o(:,3))/100;
D0o(3,6) = sum(A36_0o(:,3))/100;
...
pcolor(D0o);

I now creat a 12x12 martix D0o, and the elements indicates the average distance between M and N. So I use pcolor(D0o) to drwa the graph. But it is not intended actually. Because it cannot display the detailed distance costs or probability as what i want(like the graph link). I was thinking about whether there are functions like

contourf(A(:,1),A(:,2),A(:,3));
pcolor(A(:,1),A(:,2),A(:,3));

Matrix A is the one of first link graph. Some of the data is like this:

A = [
10  12  370
10  12  517
10  12  370
10  12  716
10  12  370
9   12  599
9   12  594
9   12  1285
9   12  588
9   12  588
8   12  986
8   12  1245
8   12  1054
8   12  1161
8   12  987
7   12  864
7   12  1075
7   12  867
7   12  515
7   12  515
6   12  933
6   12  844
6   12  578
6   12  297
6   12  578
5   12  1055
5   12  1376
5   12  1193
5   12  891
5   12  891
4   12  470
4   12  1553
4   12  782
4   12  757
4   12  470
3   12  1543
3   12  1147
3   12  1241
3   12  879
3   12  879]

rawdata; graph

Suever
  • 64,497
  • 14
  • 82
  • 101
Alex
  • 1
  • 2
  • Can you provide a smaller example of the data and expected output? Also you reference a third graph but only show one. Also provide the code that you have tried. – Suever Jan 21 '16 at 13:26
  • @Suever the data is like the one in the first graph. Sry about the third graph, I did not know i cannot add 3 links first. It is re-edit now. I will add more comments in the description. – Alex Jan 21 '16 at 13:41
  • I see that your first image contains some data, but if you can actually paste some code into your question using the code tags that includes some sample data that I can actually paste into MATLAB and play with that would be much more helpful. – Suever Jan 21 '16 at 13:45
  • @Suever I add some more description now. I cannot directly paste the codes due to there are a lot of irrelevant contents so I just paste the main related ones. – Alex Jan 21 '16 at 14:05

0 Answers0