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:
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 .
@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?
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.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!