File Exchange

image thumbnail

Matrix Structural Analysis

version (764 KB) by Hossein Rahami
A simple function for the analysis of two- and three- dimensional frame structures


Updated 18 Mar 2010

View License

The stiffness method is used for matrix analysis of structures. this program is useful for analysis of Planar trusses, Space
trusses, Beams, Planar frames and Space frames.
End release of members in frame elements and support displacements can also be applied by this program.

Cite As

Hossein Rahami (2021). Matrix Structural Analysis (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (25)


Dear Dr Hossein Rahami
Thank you so much for sharing your codes.

William Balbuena

behnam mobaraki

Hi everybody. Does anyone have Matlab code for ''Matrix Force Method'' OR ''Flexibility Method'' beam elements? This method is useful for statically indeterminate structures.

mahdy karimi

I want the file data.m , because it is not there please help me if you have the data.m file please send it to my email :


Mohammad De

I checked the code in any possible scenario and it is amazing! Thanks, Dr. Rahimi for this nice work. Note that if a beam is a cantilever at the end no in "Con" matrix it still gets Value "1" while it "Re" Matrix row is all 0 for not being supported. The only thing I am currently working on it how to get Max deflection!? as Output "V" matrix only releases the value of deflection for each node (what if the max deflection is happening in between nodes?!)

chris hunt


The file data.m is not there please help...

agil aliqqa

Thank you so much. It's very helpful to check my manual calculations. May I know how to display all the solutions like you did in the PDF attachment?

Valdinei Tadeu

Please send this program to my email. I can't acess him from this site.

IB Ugur

IB Ugur

Hi Javier Saez

Column 3 and Column 4 of D.con are used for start and end point of any element. If start point of element is fixed, you input "1", if this element has a release in this point,you input "0". For truss systems, D.con Column 3 and 4 are "0" but for frame systems, they must be "1" (if element doesn't have any release"

Javier Sáez

Thank you so much. I've a question about program Data.m. Can anyone tell me what's the meaning of columns 3 and 4 of the D.Con' matrix?


Hamid Qaemi


Thanku so much sir.I have written a code but not as simple and generalised as yours.


من دو روزه کل اینترنت رو زیر و رو کردم و انواع توابع و اسکرپیت های ماتریس سختی رو دیدم ، واقعا این چیزی که شما نوشتید یه چیز دیگه است .
و البته حالا که متوجه شدم شما ایرانی هستید اصلا یه جور دیگه واسه ام لذت بخشه .
آفرین .
ممنون از اشتراک این فایل

Dean Kayton

Do you use SI units? Else what are the units? Thanks


thanks alot



Dear Dr.Rahami,

Thank you so much, I'm trying to add the modal analysis to this code, please can you tell me what would happen to the mass matrix of the element when we release member ends?


Mostafa Tazarv

Thank you so much Dr.Rahami.
You speed up my research process.

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!