Contour(X,Y,Z), grid contour with regard to probability or distance costs

7 visualizaciones (últimos 30 días)
Alex
Alex el 21 de En. de 2016
Comentada: Mike Garrity el 21 de En. de 2016
Hi! Can contour work to create grid contour? My data is like this. 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 the matrix of second picture. But the generated graph only shows an average contour. I wanna try to generate one like the third graph. Did i try the right function or there is other more suitable one than contour()? Thank you!
if true
%code
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);
end
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
if true
% code
contourf(A(:,1),A(:,2),A(:,3));
pcolor(A(:,1),A(:,2),A(:,3));
end

Respuestas (1)

Mike Garrity
Mike Garrity el 21 de En. de 2016
Perhaps the contourf function is what you're looking for. Another possibility would be pcolor .
  2 comentarios
Alex
Alex el 21 de En. de 2016
Yes, I've already tried that but it seems they cannot work as expected. Only when i sum and average the data to be a MxN matrix it works well, but the graph cannot show the cost of each coordinate. I add a piece of code in the description. Hope it can be helpful.
Mike Garrity
Mike Garrity el 21 de En. de 2016
I see. I wasn't sure whether you were after the gridding part or the display part.

Iniciar sesión para comentar.

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by