MATLAB Answers

0

Edit an OpenSEES file from MATLAB and Change of variables from MATLAB

Asked by Andre Tahmassian on 12 Apr 2019
Latest activity Answered by Abhishek Singh on 15 Apr 2019
I have a parametric analysis to run on OpenSEES. I wonder if there is a way to do following pseudo code
  • Set a variable in MATLAB
  • Open a .tcl file
  • Set specified variable in MATLAb to a specific variable in .tcl file.
  • Run the file from MATLAB
  • Analyze results in MATLAB, save specific values in MATLAB
  • Delete results for .tcl process
  • Repeat the same process from beginning by changing variable value.
Any suggestion or example is very much appreciated.

  0 Comments

Sign in to comment.

1 Answer

Answer by Abhishek Singh on 15 Apr 2019

There is a simple line of command to run OpenSees through Matlab:
! opensees.exe *******.tcl
where it is just needed to put your tcl file name beside of *******.
You just have to :
1- Create a folder, put your M file, tcl file and a copy of opensees.exe in it.
2-write that line of command in your M file. just remember to use the exact name of exe file for the first part and the exact name of tcl file for the second part of this command.
3-Define the path of created folder in "Set Path" part of Matlab.
If you needed to put or remove a text from tcl file using matlab, take a look at "dlmwrite" command in matlab help.

  0 Comments

Sign in to comment.