Error in setting new location of Ligament in Matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Sina Tabeiy
Posts: 8
Joined: Thu Sep 05, 2019 4:15 am

Error in setting new location of Ligament in Matlab

Post by Sina Tabeiy » Wed Jul 14, 2021 12:25 pm

Hi everyone,

I was trying to implement the new location of a ligament to its origin or insertion point based on a "for" loop. My script was like below:


new_musAttachLocCoords_v3 = Vec3(new_musAttachLocCoords(1), new_musAttachLocCoords(2), new_musAttachLocCoords(3));

currentPathPoint = PathPoint.safeDownCast(currentPathPointSet.get(n_p));
currentPathPoint.set_location(new_musAttachLocCoords_v3);



(Where "n_p" is the counter of "for loop")

But I ended up getting the following error which seems a Matlab error, not APIs:

Struct contents reference from a non-struct array object.

Error in SCRIPT (line 202)
currentPathPoint.set_location(new_musAttachLocCoords_v3);



I'll be extremely thankful if someone tells me how to fix it.

Bests,
Sina

Tags:

User avatar
Sina Tabeiy
Posts: 8
Joined: Thu Sep 05, 2019 4:15 am

Re: Error in setting new location of Ligament in Matlab

Post by Sina Tabeiy » Thu Jul 29, 2021 6:25 am

Any advice?

User avatar
Thomas Uchida
Posts: 1792
Joined: Wed May 16, 2012 11:40 am

Re: Error in setting new location of Ligament in Matlab

Post by Thomas Uchida » Thu Jul 29, 2021 3:52 pm

Any advice?
Posting a minimal working example (https://en.wikipedia.org/wiki/Minimal_working_example) might make it easier for someone to help. Based on the code you have provided, it isn't clear what "new_musAttachLocCoords(1)" is, so perhaps the constructor for "new_musAttachLocCoords_v3" isn't working? You might try simplifying your code (e.g., removing the loop) to help isolate the issue.

POST REPLY