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)
Show older comments
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
2 Comments
Walter Roberson
on 17 Apr 2020
But that probably is not what you mean.
Otherwise just system() out to the TCL interpreter.
Accepted Answer
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
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?
More Answers (2)
Esengul Cavdar
on 8 Jun 2018
Edited: Esengul Cavdar
on 8 Jun 2018
1 Comment
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 ?
Esengul Cavdar
on 8 Jun 2018
5 Comments
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.
See Also
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!