Help Needed: Unrecognized Function or Variable 'getAsMat' Error

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
Ebenezer Adorão
Posts: 5
Joined: Wed Oct 26, 2022 8:27 am

Help Needed: Unrecognized Function or Variable 'getAsMat' Error

Post by Ebenezer Adorão » Tue Jun 04, 2024 5:00 am

Hello,

I am encountering an issue with my OpenSim Moco project and would appreciate any assistance. Below are the details of the errors I am facing:

Unrecognized function or variable 'getAsMat'.
Error in osimTableToStruct (line 65)
dataArray = osimtable.getDependentColumnAtIndex(iLabel).getAsMat();
Error in osimMocoTrajectoryReport (line 134)
ref = osimTableToStruct(refTable);
Error in InverseWithEMGquali (line 131)
report = osimMocoTrajectoryReport(model, ...)

Despite my efforts, I have not been able to resolve the error. Has anyone encountered a similar issue or have suggestions on how to fix this?

Any help or insights would be greatly appreciated.

Thank you!

User avatar
Nicholas Bianco
Posts: 1044
Joined: Thu Oct 04, 2012 8:09 pm

Re: Help Needed: Unrecognized Function or Variable 'getAsMat' Error

Post by Nicholas Bianco » Tue Jun 04, 2024 10:47 am

Hi Ebenezer,

If OpenSim is installed correctly, 'getAsMat()' should work out of the box. What version of OpenSim are you using?

Best,
Nick

User avatar
Ebenezer Adorão
Posts: 5
Joined: Wed Oct 26, 2022 8:27 am

Re: Help Needed: Unrecognized Function or Variable 'getAsMat' Error

Post by Ebenezer Adorão » Wed Jun 05, 2024 12:00 pm

Hello Nick,

I am using version 4.5

User avatar
Nicholas Bianco
Posts: 1044
Joined: Thu Oct 04, 2012 8:09 pm

Re: Help Needed: Unrecognized Function or Variable 'getAsMat' Error

Post by Nicholas Bianco » Thu Jun 06, 2024 9:15 am

Hi Ebenezer,

To help debug, could you go inside the 'osimTableToStruct' script and see what variable type "osimtable.getDependentColumnAtIndex(iLabel)" returns?

Best,
Nick

POST REPLY