plot demo #805
Nelson-numerical-software
started this conversation in
General
plot demo
#805
Replies: 1 comment
-
figure();
theta = pi / 4;
v_o = 1;
g = 9.81;
x_max = v_o^2 * sin(2*theta) / g;
y_max = 0.5 * (v_o * sin(theta))^2 / g;
x = linspace( 0, x_max, 20);
y = tan(theta) * x - 0.5 * g * x .^2 / (v_o*cos(theta))^2;
grid off
for i = 1:length(x)
plot(x(1:i), y(1:i));
hold on
plot(x(i), y(i), 'o');
axis([0 x_max 0 y_max]);
sleep(0.1);
end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions