wiggle.m

来自「exm for Experiments with MATLAB (by Clev」· M 代码 · 共 21 行

M
21
字号
function wiggle(X)
% WIGGLE  Dynamic matrix multiplication.
%   wiggle(X) wiggles the 2-by-n matrix X.
%   Eg: wiggle(house)
%       wiggle(hand)

clf
shg
thetamax = 0.1;
delta = .025;
t = 0;
stop = uicontrol('string','stop','style','toggle');
while ~get(stop,'value')
   theta = (4*abs(t-round(t))-1) * thetamax;
   G = [cos(theta) sin(theta); -sin(theta) cos(theta)];
   dot_to_dot(G*X);
   drawnow
   t = t + delta;
end
set(stop,'string','close','value',0,'callback','close(gcf)')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?