from
Drag your graph by slider
by Ali Talib Oudah
The slider facility has been used to drag the graph.
|
| plotfunc
|
% Edited by : Ali Talib Oudah
% E-mail: alitalib82@yahoo.com
% if you have any question just contact me.
function plotfunc
%......you can use any function you want......%
x = 0:0.01:3*pi; %
y=3*sin(6*x).*exp(-0.2*x); %
%.............................................%
plot(x,y)
xlabel('x');ylabel('y')
% the vertical slider
rr=findobj(gcf,'Tag','slider1');
r1=get(rr,'value');
% the horizontal slider
rr=findobj(gcf,'Tag','slider2');
r2=get(rr,'value');
axis([4+r2 6+r2 -2+r1 2+r1])
axis square
|
|
Contact us at files@mathworks.com