Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
-
Sina Porsa
- Posts: 99
- Joined: Thu Feb 03, 2011 7:21 pm
Post
by Sina Porsa » Wed Aug 28, 2013 12:27 am
Hi every one
I am trying to create a PiecewiseConstantFunction within a Matlab script:
Code: Select all
PiecewiseConstantFunction(nNodes, tVec, U)
where nNodes is an integer and tVec&U are two vectors (size = 1xnNodes)
When I run my script, it returns this error:
??? No constructor 'org.opensim.modeling.PiecewiseConstantFunction' with matching
signature found.
I tried to replace tVec and U with two matching
org.opensim.modeling.ArrayDoubles which didn't solve the problem.
Any ideas?
Thanks
Sina
-
Ayman Habib
- Posts: 2251
- Joined: Fri Apr 01, 2005 12:24 pm
Post
by Ayman Habib » Wed Aug 28, 2013 1:29 pm
Hi,
The PiecewiseConstantFunction class has no constructors that take Vector or ArrayDouble, instead it takes double* which is not a Java, Python or scripting construct. Your best bet is to use a sequence of calls similar to the code block below (pulled from one of our examples):
Code: Select all
PiecewiseConstantFunction bangBangControl;
bangBangControl.addPoint(initialTime,0);
Hope this helps,
-Ayman