Skip to content

Commit

Permalink
Use override instead of rewriting the XML-file
Browse files Browse the repository at this point in the history
Using the override flag of simulations is much more efficient,
especially for large models.
  • Loading branch information
sjoelund committed Oct 11, 2016
1 parent 257c15b commit d7ea0d8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions UsersGuide/source/scripting_api.rst
Expand Up @@ -44,13 +44,10 @@ Following example shows how to update the parameters and re-run the simulation w
buildModel(BouncingBall);
getErrorString();
for i in 1:3 loop
// BouncingBall_init.xml file will be generated because of buildModel call above.
// We update the parameter e start value from 0.7 to "0.7 + i".
value := 0.7 + i;
setInitXmlStartValue("BouncingBall_init.xml", "e", String(value) , "BouncingBall_init.xml");
getErrorString();
// call the generated simulation code to produce a result file BouncingBall%i%_res.mat
system("BouncingBall.exe -r=BouncingBall" + String(i) + "_res.mat");
system("./BouncingBall -override=e="+String(value)+" -r=BouncingBall" + String(i) + "_res.mat");
getErrorString();
end for;
Expand Down

0 comments on commit d7ea0d8

Please sign in to comment.