I can run a tcl file by using Matlab but I want to make serial dynamic analysis in OpenSees. How can I do it?

14 views (last 30 days)
My matlab code is
clc;
clear;
A=['1' '2' '3' '4' '5' '6' '7' '8' '9' '10']
parfor i=1:length(A)
filename= ['A(i)\Analysis_GM', num2str(i), '.tcl']
system (['OpenSees.exe<', filename]
end

Accepted Answer

Walter Roberson
Walter Roberson on 7 Jun 2018
Replace
A=['1' '2' '3' '4' '5' '6' '7' '8' '9' '10']
filename= ['A(i)\Analysis_GM', num2str(i), '.tcl']
with
filename = sprintf('%d\\Analysis_GM%d.tcl', i, i);
Or if your A might have non-integer names then for example
A = {'1' '2' 'C' '4' 'QRZ' '6' '7' '8' '9&change' '10'};
filename = sprintf('%s\\Analysis_GM%d.tcl', A{i}, i);
  2 Comments
Walter Roberson
Walter Roberson on 7 Jun 2018
What is the content of the filename variable when you have the problem? Does the file that it names exist relative to the current directory?

Sign in to comment.

More Answers (2)

Esengul Cavdar
Esengul Cavdar on 8 Jun 2018
Edited: Esengul Cavdar on 8 Jun 2018
The Analysis_GM file contains information about the building to be analyzed and the earthquake. The codes in the file are like text, not matrix.
  1 Comment
Walter Roberson
Walter Roberson on 8 Jun 2018
Okay, but that is not what I asked. I asked what the contents of the filename variable is when the problem happens. For example is it
'1\Analysis_GM1.tcl'
and if so then does file Analysis_GM1.tcl exist in the folder named "1" inside the current directory ?

Sign in to comment.


Esengul Cavdar
Esengul Cavdar on 8 Jun 2018
Filename is like '1/Analysis_GM.tcl'. The variable is just the folder name (from 1 to 20) and the tlc file is same.
  5 Comments
Sadia
Sadia on 25 Nov 2020
Edited: Sadia on 25 Nov 2020
I am having difficulty in running a simpl tcl file in matlab.
if I save my m file, tcl file and opensees.exe file in a same folder and run the script file with !opensees.exe****.tcl
where ****=tcl file name.
I am getting the following error,
opensees.exe is not recognize as an internal or external command operable program or batch. Kindly sort my issue I know its simple but couldnt figure out mistake.

Sign in to comment.

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!