impoint issue: setPosition in a addNewPositionCallback function

1 vue (au cours des 30 derniers jours)
Rogelio
Rogelio le 22 Avr 2014
Modifié(e) : Rogelio le 22 Avr 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?

Réponses (0)

Catégories

En savoir plus sur Simulink Environment Customization dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by