AnyBody and Matlab

Dear all

I want to do a sensitivity analyses and need to run AnyBodyCon.exe via Matlab
before asking problems;I tried a lot to solve it by myself but I could not.
I have three main question:
1)I use !AnyBodyCon.exe & to run AnyBodyCon via matlab.It opens Dos window but when I type :load"demo.outputfile.any"
it generates error .this .any file is in the same directory with AnyBodyCon.exe.
Secondly ;i need to import a Macro to AnyBodyCon.exe.Each time ,Matlab should changes the name of c3d file in the macro and then import it in to anybodycon.exe
2)How the macro file can be manipulated by matlab since matlab can only read and write txt,csv,xls file
3)how matlab can import editted macro file in to AnyBodyCon.exe?
please help me before my supervisor come back from holiday !!!:eek::frowning:

When I use !AnyBodyCon.exe & to run anybodycon.exe via matlab : the dos window opens but when I try to load .any file in that directory it generate the error :

ERROR<SCR.SCN9>:System and Load argument definition <virtual File><8>:
"system and load argument definitions <virtual File>AnyBodyCon.exe:path does not exist
Model loading skipped

Please help me
:frowning:

Hi Marzieh,
I received your private message, and prefer answer to you here ; maybe could it help other people :wink:

My first question for you is : which version of anybody are you using ?? I developed function for the version 5.x but did not try for v.6.

1)I use !AnyBodyCon.exe & to run AnyBodyCon via matlab.It opens Dos window but when I type :load"demo.outputfile.any". it generates error .this .any file is in the same directory with AnyBodyCon.exe.

It's pretty hard to know the reason of the problem for me... Maybe Anybody developer would be more prone to help you about that ; my advices to help you solving it would be :
1/ what is exactly this file ?
2/ where did you find it ?
3/ did you compare it with the one that you can dowmload from the tutorial section ?
4/ Have you set the path as explained in the tutorial ?

Secondly ;i need to import a Macro to AnyBodyCon.exe.Each time ,Matlab should changes the name of c3d file in the macro and then import it in to anybodycon.exe

For that I would create in a first time as many macro as your c3d files with other c3d name in each macro. After creating all the macro I would launch the analysis and change the macro name to take into account another c3d file.

2)How the macro file can be manipulated by matlab since matlab can only read and write txt,csv,xls file

I'm not sure to understand your question : is it about the way to write the *.anymacro file or to read it ? If for writting : no problem : *.anymacro is as a *.txt file but only the extension change. If for reading : you don't deal with it in matlab but in the anybodycon.exe.

3)how matlab can import editted macro file in to AnyBodyCon.exe?
Something like that :

CommandDos = sprintf('"C:/Program Files (x86)/AnyBody Technology/AnyBody.5.3/Anybodycon.exe" /m %s', File{nStudy}.Macro );
    dos(CommandDos)

I can share my matlab function to help you creating macro, creating inputfiles to take into account several input parameters, launching cmd and anybodycon.exe and storing results files. Just send me your e-mail via private message :wink:

Hi dear friend

The file which i am trying to load (Demo.OutputFile.any) belongs to the tutorial and I put it exactly where the AnyBodyCon.exe is . however mt My Matlab is installed on another path and i need to set its directory manually.

I am using AnyBody 5.2

Many thanks , you answer one of my major questions :
So Macro is a txt file which can be write or manipulate by matlab
but then you wrote after writting a txt file , the extension should be changed to convert it to a real “macro” file .
Can you please explain how I can do that ?:confused:
Sorry because my master was control engineering , i am rather new to AnyBody .
another thing ,
I never forget your help if you share your matlab files with me
Many thanks !
looking forward for any help:(

Hi !
Regarding your problem of path, I think that if you set your envrionment variable path correctly, everything should be working… In fact I never had any problem because matlab and anybodycon.exe had several path.

You don’t write a .txt file, you directly write the “*.anymacro” file. No need to change it into an executable file. In fact I think you just have to see it as a file with successive operations to launch. Each time anybodycon.exe launched an operation and finished executing, it launch the next line written in you macrofile.

Hope my functions will help you.
Lauranne