- /
-
Sine bounce
on 6 Nov 2023
- 6
- 48
- 2
- 0
- 87
drawframe(20);
Write your drawframe function below
function drawframe(f)
% Made by asking the AI playground to modify the original function
% so that the marker moves in the y direction each frame as well as in the x direction
x = abs(f-24)/24; % Calculate the x position of the marker based on the frame number
y = sin(f/4); % Calculate the y position of the marker based on the frame number
plot(x,y, ... % Plot the marker at the calculated position
Marker=".", ... % Set the marker style to a dot
MarkerSize=100) % Set the marker size to 100
axis([0 1 -1 1]) % Set the axis limits
end