Page 1 of 1

Error in setting new location of Ligament in Matlab

Posted: Wed Jul 14, 2021 12:25 pm
by sinatabeiy
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

Re: Error in setting new location of Ligament in Matlab

Posted: Thu Jul 29, 2021 6:25 am
by sinatabeiy
Any advice?

Re: Error in setting new location of Ligament in Matlab

Posted: Thu Jul 29, 2021 3:52 pm
by tkuchida
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.