Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
-
Robert Steidl
- Posts: 16
- Joined: Tue Nov 24, 2015 3:03 am
Post
by Robert Steidl » Wed Dec 21, 2016 1:44 am
Hello, again me, and again with a similar issue,
i want to create a linear function for the force in MatLab - the c++ code looks so:
Code: Select all
PiecewiseLinearFunction *forceX = new PiecewiseLinearFunction(2, time, fXofT);
In MatLab i can acces to the constructor like:
Force = PieceWiseLinearFunction();
but how can i add the parameters time and fXofT in MatLab??
-
Robert Steidl
- Posts: 16
- Joined: Tue Nov 24, 2015 3:03 am
Post
by Robert Steidl » Wed Dec 21, 2016 4:53 am
Thank you,
thats a good point - for my understanding, if I have the timepoints at 0 and 2 and the corresponding force at 0 and 15 my code should look like:
Code: Select all
Force = PiecewiseLinearFunction();
Force.addPoint(0, 0);
Force.addPoint(2, 15);
Am I right?
-
Thomas Uchida
- Posts: 1802
- Joined: Wed May 16, 2012 11:40 am
Post
by Thomas Uchida » Thu Dec 22, 2016 10:39 pm
Yes, that code looks correct. I recommend getting into the habit of running tests using simple models and verifying that the answers are what you expect before trying to tackle more complex problems.