Please answer fast and include copy code. Im using matlab r2016b. .. dont have t
ID: 3571809 • Letter: P
Question
Please answer fast and include copy code. Im using matlab r2016b. .. dont have to be correct just show something2. Decaying circle. wrte plotdecay.m, that animates the plotting of the a program, following parametrically defined motion characterized by T and t. In addition to plotting the motion, plot a line from the origin to the point, for each point plotted r roe r r(t)cos (at) r (t)sin(at) 3. Ellipse. Write a program, plotellipse.m, that animates the plotting of the following parametrically defined motion characterized by T and p. r cos(at) r sin(at p) 4. Lissajous. Write a program, plotLJ.m, that plot the following parametrically defined motion characterized by T, a, b, and p. rcos (aat) r sin (bat Add the option to animate the motion (animateON true or false) in a second figure (see help figure in the Command window) after pausing 2 seconds to see the complete graph.
Explanation / Answer
For question 2:
function [] = plotdecay( r0, omega, tau, T )
figure(1);
hold on;
xlim([-r0,r0]);
ylim([-r0,r0]);
for i=1:size(T,2)
t = T(1,i);
r = r0*exp( (-t*1.0)/tau );
x = r*cos( omega*t );
y = r*sin( omega*t );
for j=1:1000
plot( (x*j*1.0)/1000, (y*j*1.0)/1000 ,'b');
hold on;
end
plot( x, y, 'r.' );
hold on;
pause(0.5);
end
%example run : plotdecay( 1,2,3, 1:10);