This is example code on how to interact between OpenSees and Matlab. The routine writes tcl code, run OpenSees, and read/extract output file. This code use the official Truss example from OpenSees:
https://opensees.berkeley.edu/wiki/index.php/Basic_Truss_Example
Please create the "Truss.tcl" from that website, the opensees analysis will generate "example.out" as output.
Note that all matlab .m, .tcl, and opensees.exe files need to be in the same folder.
Gifari Zulkarnaen (2021). OpenSees-Matlab Interaction of Truss Example (https://www.mathworks.com/matlabcentral/fileexchange/74949-opensees-matlab-interaction-of-truss-example), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
@Consuelo Alvarado: You need to have "Truss.tcl" file in the same folder. Download or copy it from OpenSees website: https://opensees.berkeley.edu/wiki/index.php/Basic_Truss_Example
@Luis Bohorquez: Sorry I don't know about Mac
How can I run the Matlab code in a Mac? How is the command to run an executable?
Hello,
I have the following error:
Error using fscanf
Invalid file identifier. Use fopen to generate a valid file identifier.
I don't know what does that mean, because i'm learning how to use OpenSees and matlab.
Thanks you!