I am trying to make a plot of some coordinates that represent each node in the system and get the lines drawn as shown in the figure. Making a plot for the coordinates is no problem, writing a script that can make the lines, im clueless.
Thank you

댓글 수: 2

Doug Hull
Doug Hull 2013년 10월 2일
It looks like you have done it.
You will need to tell us how the connectivity data is stored. My guess is you have a matrix holding the XY data, and a second matrix storing the connectivity of the nodes. Please explain what this format is.
Simen
Simen 2013년 10월 2일
편집: Simen 2013년 10월 2일
The lines on the picture is drawn "by hand" postprocess.
NodeCoordinates = [0 0;500 0;500 500;1000 0;0 500] (xy for node 1 2 3...)
ElementNodes = [ 1 2 ; 1 3 ; 2 3 ; 2 4 ; 3 4 ; 5 3 ] (connectivity of each node)
So when extracting the different x and y values I use:
xx = NodeCoordinates(:,1)
yy = NodeCoordinates(:,2)

댓글을 달려면 로그인하십시오.

 채택된 답변

Kelly Kearney
Kelly Kearney 2013년 10월 2일

0 개 추천

The gplot function is probably the easiest way to do this:
xy = NodeCoordinates;
ee = ElementNodes;
n = size(xy,1);
adj = sparse(ee(:,1), ee(:,2), ones(size(ee,1),1), n,n);
gplot(adj, xy);
hold on;
plot(xy(:,1), xy(:,2), 'k.');

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2013년 10월 2일

답변:

2013년 10월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by