0

我试图找到一种在 MATLAB 中绘制桁架的方法,我可以通过使用邻接矩阵和 gplot 函数来做到这一点,但它的方法非常冗长,尤其是在有很多节点相互连接的情况下。有没有更快的方法来做到这一点?

4

2 回答 2

1

如果这是材料力学意义上的桁架:

http://www.mathworks.com/matlabcentral/fileexchange/2170-mastering-mechanics-1-using-matlab-5

和配套书

http://www.amazon.com/Mastering-Mechanics-Using-MATLAB-Materials/dp/0138640343

我在其中写了一些桁架可视化和材料的一般强度。

于 2010-05-20T13:37:06.977 回答
1

我认为 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');
于 2010-05-20T01:22:59.667 回答