AnyBody-Matlab simulation

Hi all,

I am trying to make a connection between Matlab and AnyBody model. I read the tutorial and I know that Matlab should call AnyBodyCon.exe application which would read AnyBody model and execute commands specified in *.anymcr file.

This works fine if I want to run AnyBody model and process results after AnyBody has finished with computations. What I would like to do is following. Matlab reads in each step of my simulation some of AnyBody outputs, makes some decision based on the purpose of the simulation and creates some variable which would be an input to AnyBody model in the next step of the simulation.

Does anybody know how can I do that? Thank you very much for your help.


Hi Jovana,

The easiest way to do such a thing would be to use the Python hook we have available in AMS.

Please look for the object AnyFunEx in the manual there is a small example in the bottom of this page.

This object can work with both python and compiled c code (DLL. If it is possible to have matlab create a DLL then this might be a way to utilize matlab in the way you need i have never tried this though. Otherwise it would be easier for you to use python for this work instead of matlab.

There are more information to be found on the wiki page:

And in this recent webcast.

Best regards

Dear Soren,

Thank you very much for your reply and for sharing links with me. Do you know where could I find an example done with compiled c code? Thank you again.


Hi Jovana,

Please open a reference manual and search for “AnyFunExMonoC” - it should have an example. Similarly you can search for AnyFunExMonoPy.

Kind regards,