Problem with invoke Matlab function on OpenSees
Moderators: silvia, selimgunay, Moderators
-
- Posts: 2
- Joined: Tue Mar 24, 2015 2:13 am
- Location: civiconcebe
Problem with invoke Matlab function on OpenSees
Hi,
I need to run a Matlab Function from OpenSees (TCL script). For this task I follow the script present on this link: http://opensees.berkeley.edu/wiki/index ... om_a_Scipt
My problem is:
When I invoke Matlab function from TCL script, the OpenSees doesn't wait for the Matlab results, e.g., OpenSees runs at the same time as the Matlab Function.
My question is:
How to force OpenSees waiting for the Matlab results?
Thank you
Rúben Rosário
I need to run a Matlab Function from OpenSees (TCL script). For this task I follow the script present on this link: http://opensees.berkeley.edu/wiki/index ... om_a_Scipt
My problem is:
When I invoke Matlab function from TCL script, the OpenSees doesn't wait for the Matlab results, e.g., OpenSees runs at the same time as the Matlab Function.
My question is:
How to force OpenSees waiting for the Matlab results?
Thank you
Rúben Rosário
Re: Problem with invoke Matlab function on OpenSees
don't call OpenSees from the matlab script until you have the results
-
- Posts: 2
- Joined: Tue Mar 24, 2015 2:13 am
- Location: civiconcebe
Re: Problem with invoke Matlab function on OpenSees
Dear Frank, thank you for your answer.
My problem is exactly the inverse. I am calling the Matlab script from the OpenSees using this function:
# invoke matlab
if {[catch {exec matlab -nosplash -nodesktop -r "myFunction; quit"}]} {
puts "Ignore this $msg"
}
The OpenSees doesn't wait for the results of my Matlab function, OpenSees and Matlab runs simultaneously.
Best regards
Rúben Rosário
My problem is exactly the inverse. I am calling the Matlab script from the OpenSees using this function:
# invoke matlab
if {[catch {exec matlab -nosplash -nodesktop -r "myFunction; quit"}]} {
puts "Ignore this $msg"
}
The OpenSees doesn't wait for the results of my Matlab function, OpenSees and Matlab runs simultaneously.
Best regards
Rúben Rosário
Re: Problem with invoke Matlab function on OpenSees
Dear RubenRosario,
I have the same problem. what did you do about it?
I have the same problem. what did you do about it?
Re: Problem with invoke Matlab function on OpenSees
this is really a tcl issue. have you looked elsewhere, e.g.
http://stackoverflow.com/questions/2504 ... xt-command
http://stackoverflow.com/questions/2504 ... xt-command
Re: Problem with invoke Matlab function on OpenSees
thank you very much Dr. McKenna,
I found out that Tcl has an "after" command that runs any commands that come after it after some time that is specified by the user. so, I invoked my Matlab code from within Tcl, and then using "after 30000" command, Tcl waited for 30 seconds (30000 m seconds) to run the rest of the code. it worked fine for me.
I found out that Tcl has an "after" command that runs any commands that come after it after some time that is specified by the user. so, I invoked my Matlab code from within Tcl, and then using "after 30000" command, Tcl waited for 30 seconds (30000 m seconds) to run the rest of the code. it worked fine for me.