Problem with invoke Matlab function on OpenSees

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
RubenRosario
Posts: 2
Joined: Tue Mar 24, 2015 2:13 am
Location: civiconcebe

Problem with invoke Matlab function on OpenSees

Post by RubenRosario »

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
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Problem with invoke Matlab function on OpenSees

Post by fmk »

don't call OpenSees from the matlab script until you have the results
RubenRosario
Posts: 2
Joined: Tue Mar 24, 2015 2:13 am
Location: civiconcebe

Re: Problem with invoke Matlab function on OpenSees

Post by RubenRosario »

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
aghaf
Posts: 6
Joined: Tue Jan 19, 2016 6:54 pm

Re: Problem with invoke Matlab function on OpenSees

Post by aghaf »

Dear RubenRosario,

I have the same problem. what did you do about it?
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Problem with invoke Matlab function on OpenSees

Post by fmk »

this is really a tcl issue. have you looked elsewhere, e.g.
http://stackoverflow.com/questions/2504 ... xt-command
aghaf
Posts: 6
Joined: Tue Jan 19, 2016 6:54 pm

Re: Problem with invoke Matlab function on OpenSees

Post by aghaf »

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.
Post Reply