No BSD License  

Highlights from
Truss Analysis

4.4 | 15 ratings Rate this file 160 Downloads (last 30 days) File Size: 92.9 KB File ID: #14313 Version: 1.0
image thumbnail

Truss Analysis



17 Mar 2007 (Updated )

A very simple M-file for analysis of any truss

| Watch this File

File Information

A very simple M-file for analysis of any truss (2-D & 3-D), calculating of forces, deflections , reactions and drawing the truss and deformation shape


This file inspired Truss Solver And Genetic Algorithm Optimzer, Truss Analysis, Teaching Learning Based Algorithm For Truss Optimization, and Truss Optimization With Matlab Genetic Algorithm (Ga) Function.

MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (16)
11 Dec 2012 Chris Jobes

Very concise code, a bit hard to understand for a novice without a lot of work, but pretty straight forward for those of us in the field. I decided to compare it to a MATLAB script that I wrote based upon Moaveni's book many years ago. It was not nearly as concise, but much more understandable.

I do have an issue with the ST.m code, however. There appears to be an error that only appears if a load is applied to a node that has constrained movement in that direction.

A quick check of the applied loads and reaction force sums should yield 0 in the x and y directions. In one of my test scripts, it did not. The test was a roof truss with snow load concentrations applied at the upper nodes. Two of those nodes had vertical constraints where the truss rested on the wall top plates and the reaction forces I calculated using this script were incorrect.

The fix is easily made and only appears in an odd case. Line 9 should be:


since R=KU-F. I have not yet tested your MSA code, but at a glance, it appears to have the same issue.

Otherwise, great job.

31 Oct 2012 tong mu  
06 Sep 2012 Frank McHugh

Frank McHugh (view profile)

For the convience of those who found this code to obtuse, I've uploaded a copy with the ST function reformatted and extensive comments added at
No actual code changes but should be easier to understand, and have confidence in this code

Comment only
25 Aug 2011 Jeffrey Kantor

Jeffrey Kantor (view profile)

Amazingly brief, but hard to decipher. Sorry to be a killjoy, but this would be better if the functions included even minimal comments and documentation, and was written for clarity rather than brevity.

21 Mar 2011 mohan l  
24 Feb 2009 Guillermo Rein

Thanks for sharing this excellent script. I have used it for two years now in my Mechanical Design course (~60 students each). The students find difficulties in the Help.doc document but otherwise the code is robust, simple and fast to solve trusses.

04 May 2008 helen joli  
29 Feb 2008 Charlie Seviour


20 Feb 2008 Emilio Elli  
02 Nov 2007 ali yaseri


01 Jul 2007 mohamad ordelalu

tanks alot

27 May 2007 navid amiry

thanks for this file

23 May 2007 Ali Özgül

+Publis M-files application and theory (1)
+Graphical program interface (5)
+Workable program description (2)
+Works references (3)

+M-files complexity (4)
+Mlint error message (5)
+Help problems (2)
+Filename of clashes (5)
+Clone the code line (5)
+Program's symbolic manuscript (3)
+Program samples and runing test (3)
+System requirements (5)
+Program running speed (5)

Files archive:
Seleceted file name (3)
Per files comment (3)
All files usefuly (4)

Nice works, I think needs improvements.
Good works.

10 Apr 2007 Menza T

Nicely written.

23 Mar 2007 anjo mirend

great works :) thanks

20 Mar 2007 edurzimo porteynizm

that's very brief! excelent

20 Mar 2007

A New Help

21 Mar 2007


26 Mar 2007

Changing Category

26 Mar 2007

Plot The Truss

26 Mar 2007

Draw Truss and Deformation Shape

27 Mar 2007

Adding an image

12 Apr 2007


Contact us