function []=plottruss(x,E,v) % plots a truss with nodes x and bars E with volume v: % % x: 2 (m+r) x 1 vector containing all nodes % ((x_1)_1,(x_1)_2,...,(x_(m+r1))_1,(x_(m+r))_2)' % E: n x 2 array containing the node indices of the bars % [i1 j1] % [i2 j2] % [ : : ] with 1<=ik1e-3*dmax plot([x(2*(i-1)+1),x(2*(j-1)+1)],[x(2*(i-1)+2),x(2*(j-1)+2)],'linewidth',(10/dmax)*v(k)/l(k)); end hold on end axis equal hold off