Patch moving with keyboard
5 ビュー (過去 30 日間)
古いコメントを表示
Hi all, I have a little problem. I have created the patch object in a figure with an axes and then i have placed it at some location using the transformation. Now i want to move it using the arrows or an any other button on my keyboard.
Here is an example:
function[] = main()
fig....
ax...
set(Fig,'KeyPressFcn',@KeybordMoving);
end
function[] = patch()
t=0:pi/2:2*pi;
x=cos(t);
y=sin(t):
handle=patch(x,y,[0 0 0]);
Tx=-1;
T=makehgtform('translate', [Tx 0 0]);
M=T;
AxT=hgtransform('parent', gca, 'matrix', M);
end
function[] = KeboardMoving(hobject, event)
switch event.Key
case 'something'
case 'something'
end
end
Each press on key i would like to move it left or right. thanks for help.
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Polygons についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!