impoint issue: setPosition in a addNewPositionCallback function

1 Ansicht (letzte 30 Tage)
Rogelio
Rogelio am 22 Apr. 2014
Bearbeitet: Rogelio am 22 Apr. 2014
Hi
Is there a way to use setPoint in a addNewPositionCallback function. I want to reallocate a draggable point (setting dynamic restrictions) so that the impoint is restricted for example to a certain slope movement, or attached to a certain curve.
This is the general idea, where BaP is a global array of imPoints and B2Ba is an angle:
addNewPositionCallback(BaP(2),@Interact);
function Interact(Pos)
global BaP B2Ba
P=getPosition(BaP(1));
setPosition(BaP(2),[Pos(1,1) P(1,2)-Pos(1,1)*tan(B2Ba)]);
But it doesn't get repositioned as i wanted. Checking the impoint object, the property insideSetPoint is not letting me change the current position further using setPosition. Is there a workaround for this? Or any way of getting the desired behaviour?

Antworten (0)

Kategorien

Mehr zu Simulink Environment Customization finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by