How do I get this to plot correctly?
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
%%
% Constant Acceleration Calculator
% Constant Velocity is = Initial Velocity + Constant Acceleration * Time
%Vi = initial velocity
%dt = delta (t) or how long are we accelerating
% ac = acceleration constant or holding the pedal down
% Vi + constant acceleration * delta(t)
Vi = input('Initial Velocity ');
dt = input('Change in time ');
ac = input('Constant acceleration ');
constant_velocity = Vi + dt * (ac);
y = linspace(-10,30);
x = constant_velocity;
hold on
plot(x,y)
grid on
fprintf('%f Meters per / Sec',y)
0 个评论
回答(1 个)
KSSV
2020-10-7
%%
% Constant Acceleration Calculator
% Constant Velocity is = Initial Velocity + Constant Acceleration * Time
%Vi = initial velocity
%dt = delta (t) or how long are we accelerating
% ac = acceleration constant or holding the pedal down
Vi = input('Initial Velocity ');
dt = input('Change in time ');
ac = input('Constant acceleration ');
t = -10:dt:30;
constant_velocity = Vi + t * (ac);
x = constant_velocity;
hold on
plot(t, x)
grid on
% fprintf('%f Meters per / Sec',y)
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!