我试图在MATLAB中找到一种绘制桁架的方法,我可以通过使用邻接矩阵和gplot函数来实现,但它的方法非常长,特别是当有很多节点相互连接的时候。有没有更快的方法来做这件事?
发布于 2010-05-20 09:23:00
我认为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-20 21:37:07
如果这是材料力学意义上的桁架:
http://www.mathworks.com/matlabcentral/fileexchange/2170-mastering-mechanics-1-using-matlab-5
和支持的书
http://www.amazon.com/Mastering-Mechanics-Using-MATLAB-Materials/dp/0138640343
我写了一些桁架可视化和材料的一般强度到这里面。
https://stackoverflow.com/questions/2870061
复制相似问题