2010-05-19 5 views
0

MATLAB에서 트러스를 그릴 방법을 찾으려고합니다. 인접 행렬과 gplot 함수를 사용하여 트러스를 작성할 수 있지만, 연결되어있는 노드가 많은 경우 특히 길어졌습니다. 서로에게. 이 작업을 수행하는 더 빠른 방법이 있습니까?MATLAB과 gplot

답변

0

gplot은 트러스를 그릴 좋은 기능이라고 생각합니다. 그러나 인접성 매트릭스의 생성을 단순화하는 것이 가능할 수 있습니다. 하여 coordinates는 N 별 2 어레이에 저장되고, 이하 dMax 의해 분리되는 모든 노드 쌍 스트럿이 있으면

예를 들어,과 같이 인접 행렬을 생성 할 수

%# create a distance matrix 
distMatSquared = coordinates * coordinates'; %' #SO formatting 

%# create an adjacency matrix that has a 1 wherever 
%# distMatSquared is smaller than dMax^2, and that has 0 everywhere else 
adjacencyMatrix = distMatSquared < dMax^2; 

%# plot the truss with circles at the nodes 
figure,gplot(adjacencyMatrix,coordinates,'-o'); 
+0

Thks, 내 트러스로 작동 시키려면 생각을 조금 어지럽 힐 필요가 있지만 회신은 들려주세요. – JPC

관련 문제