Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

display my generated matrix

2 visualizaciones (últimos 30 días)
tumpa pal
tumpa pal el 15 de Mayo de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
for i=1:NumOfNodes
for j=1:NumOfNodes
dist(i,j)=sqrt((S(j).xd-S(i).xd)^2+(S(j).yd-S(i).yd)^2);
end
end
how could I display dist(i,j) in a matrix format

Respuestas (2)

Fangjun Jiang
Fangjun Jiang el 15 de Mayo de 2020
disp(dist)
open('dist')
  1 comentario
tumpa pal
tumpa pal el 15 de Mayo de 2020
thank you

Bjorn Gustavsson
Bjorn Gustavsson el 15 de Mayo de 2020
You can always use imagesc to display the matrix as a pseudo-coloured image:
imagesc(dist),colorbar
There are plenty other 2-D+ visualizations functions with slightly different tilts to them, and additional bells and whistles, have a look around in the documentation for graphics: 2D and 3D plots, and also take a browse-around on the file exchange - (never write a line of matlab-code until you've searched the file-exchange for contributions that solves your problem! Unless you do it for fun or learning...)
HTH

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by