Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a matlab Program to have animated sine graph with a marker ‘o’ tracing out

ID: 3833971 • Letter: W

Question

Write a matlab Program to have animated sine graph with a marker ‘o’ tracing out a sine curve with leaving a trail behind it. The drawn sine figure should be erased each time as it is redrawn for creating a classic animation effect

A MATLAB R2014a Figure 1 HOME PLOTS Find Files Insert E fx File Edit View Insert Tools Desktop Window Help Compare Comment Save Out ndent A C: Users aveed Documents MAT C Editor CAUsersuave Current Folder 1.5 Name colorwheel 256.bmp animat. comprem compression 0.5 deconvblind1.m pi/4 t disssm plot drive openloop vs sfun.meow64 xor' ah random,m none t formatter -0.5 ge00.m 10 grapp m ain (x helpppp.m 12 1.5 13 image .mat 14 PG File 10 20 30 Workspace Command Window [0,1,1,0] 10c10 sparse dout Error in selection Link line 107 1236, 218,3l 3S0 2001200 double bind 7786d double animm 50 60 script Search Documentation graPP Ln 1 Col 1 5.11 PM 4/8/2017

Explanation / Answer

Solution:

Executable Code:

x=0:0.05:15*pi;
y=sin(x);
curve=animatedline('Color','b','Marker','o');
set(gca,'XLim',[0 15*pi],'YLim',[-1 1]);
grid on;
legend('Animated Wave');
for i=1:length(x)
   addpoints(curve,x(i),y(i));
   drawnow
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote