using Matlab only please.
function sail_boat
x = linspace(0,100,2*pi);
for x
plot(x, sin(x),'b','LineWidth',3)
axis([0,2*pi+.1,-1.05,1.05])
hold on
boat(x,sin(x))
pause(.05)
end
function boat(x,y)
xc = [x-.1,x+.1,x+.2,x-.2,x-.1];
yc = [y,y,y+.1,y+.1,y];
plot(xc,yc,'k')
The function is supposed to plot a sine curve and an animation
of a representation of a boat moving on top of the curve, but the
code has several errors. Notice that the program uses modulization
and it calls another function inside sail_boat. Correct the code
and submit it with a new...