impoint issue: setPosition in a addNewPositionCallback function

조회 수: 1 (최근 30일)
Rogelio
Rogelio 2014년 4월 22일
편집: Rogelio 2014년 4월 22일
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?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by