Reading C3D Files Using Matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Seyram Ofori
Posts: 6
Joined: Fri Dec 21, 2018 12:26 am

Reading C3D Files Using Matlab

Post by Seyram Ofori » Thu Oct 03, 2019 7:01 am

Trying to run the file that will help me extract the data from the C3D file using Matlab returns this error:

Error using osimC3D
Error: File: osimC3D.m Line: 239 Column: 4
Illegal use of reserved keyword "methods".

Error in Matlab_Extraction (line 11)
c3d = osimC3D(c3dpath,1);

I am using the file as it is, undoctored.
What should I do to get this up and running without any further hitches?

Tags:

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Reading C3D Files Using Matlab

Post by jimmy d » Thu Oct 03, 2019 7:16 am

What version of Matlab are you using? The code was built on more recent Matlab versions (2018). Line 239 deals with hidden methods, perhaps you are using an older version of Matlab that doesn't have support for hidden methods in classes. You can either edit osimC3D.m to expose the functions or use some other C3D -> OpenSim methods.

User avatar
Seyram Ofori
Posts: 6
Joined: Fri Dec 21, 2018 12:26 am

Re: Reading C3D Files Using Matlab

Post by Seyram Ofori » Thu Oct 03, 2019 7:40 am

Hello James,
I am using the 2018 Matlab. And I realised the "methods" was used in an earlier line but that didn't raise any red flags when running the file so maybe exposing it like you suggested might help. How would I expose it though?

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Reading C3D Files Using Matlab

Post by jimmy d » Thu Oct 03, 2019 8:21 am

Some info on Matlab classes. You can remove the specification of the private methods and just have a single block of functions.

Code would go from this;

Code: Select all

methods
... % User exposed functions
end

methods (Access = private, Hidden = true)
... % Hidden functions not for the User.
end
To this;

Code: Select all

methods
... % User exposed functions
... % Hidden functions not for the User. (Now exposed)
end

User avatar
Seyram Ofori
Posts: 6
Joined: Fri Dec 21, 2018 12:26 am

Re: Reading C3D Files Using Matlab

Post by Seyram Ofori » Thu Oct 03, 2019 8:42 am

Great, just tried it, that error is gone. Thanks for the help James

POST REPLY