Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

display my generated matrix

조회 수: 1 (최근 30일)
tumpa pal
tumpa pal 2020년 5월 15일
마감: MATLAB Answer Bot 2021년 8월 20일
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

답변 (2개)

Fangjun Jiang
Fangjun Jiang 2020년 5월 15일
disp(dist)
open('dist')
  댓글 수: 1
tumpa pal
tumpa pal 2020년 5월 15일
thank you

Bjorn Gustavsson
Bjorn Gustavsson 2020년 5월 15일
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

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by