1. Engineering
  2. Computer Science
  3. this is what i have on the previous queation clf...

Question: this is what i have on the previous queation clf...

Question details

Copy your code from the previous problem. Add code to set the style of the lines (beams) to indicate the force acting on each beam from Problem 2. 1. Color the beams red for compression (when the force is negative) and green for tension (when the force is positive). You will want to use an if statement to decide which color to use based 2. Set the line width equal to the magnitude of the force divided by 1000. Use the abs command Finally, plot large dots at the positions of the nodes for stylistic effect. To achieve this effect, plot A crude version of what your plot should look like is shown below. Save your plot to file as on the sign of the force Fj on the j -th beam to calculate magnitude black dots with the marker type ., with the size of the markers set to be 80 truss.bridgeforces.png

this is what I have on the previous queation:

clf;
set(gcf,'position',[20 50 600 250], 'paperpositionmode', 'auto')
hold on


nodes=[0 0; 0.5 sqrt(3)/2; 1.5 sqrt(3)/2; 2.5 sqrt(3)/2;3.5 sqrt(3)/2;4 0; 3 0; 2 0; 1 0];

beams=[1 2; 2 3; 3 4; 4 5; 5 6; 6 7; 7 8; 8 9; 9 1; 2 9; 9 3; 3 8; 8 4;4 7; 7 5];
  
for jj=1:15
plot(nodes(beams(jj,:),1),nodes(beams(jj,:),2))
end
axis equal;
axis([-.5 4.5 -.5 1.5]);
print(gcf,'-dpng', 'truss_bridge_beams.png')

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution