vertical throw in matlab?
7 ビュー (過去 30 日間)
古いコメントを表示
So I have the following situation: Phase one: something is being accelerated using a spring with a certain lenght, hence gaining a certain velocity. Phase two: vertical throw with said starting velocity. My question: how am i able to plot these two phases (acc., velocity and position) in one graph? If I'd go with the classical approach learned in physics class I'd end up with two different equations for phase one and two, so how can i combine them? don't know if this makes sense since i am an absolute beginner at matlab. I tried plotting both phases separately but that kind of defeats its purpose. any tips?
5 件のコメント
回答 (2 件)
Image Analyst
2020 年 4 月 13 日
I'd use three plots, all plotted with time as the x axis. Why? Because they could all have vastly different ranges! Let's say you dropped something from an airplane. The distance plot could range from 0 to 40,000 feet while the acceleration would be a constant 9.8 m/s^2. And velocity could be from 0 to 195 km/hour. So plotting the acceleration on the same plot as the position would make the acceleration plot virtually unnoticeable and the velocity barely noticeable. Of course you could do it if you want:
plot(t, acc, '-'); % Plot acceleration vs. time.
hold on;
plot(t, velocity, '-');
plot(t, position, '-');
legend('Acceleration', 'Velocity', 'Position');
grid on;
xlabel('Time', 'FontSize', 15);
ylabel('Accel, Velocity, or Position', 'FontSize', 15);
0 件のコメント
Mehmed Saad
2020 年 4 月 14 日
Define three different times for acceleration, velocity and position if there time is different (remember that each time vector size must be equal to corresponding accelaration vector, velocity vector and position vector)
t_acc = starting_acc_point:sampling_time:ending_acc_point;
t_vel = starting_vel_point:sampling_time:ending_vel_point;
t_pos = starting_pos_point:sampling_time:ending_pos_point;
Now plot them
figure,plot(t_acc,acc),hold on,plot(t_vel,vel),hold on,plot(t_pos,pos)
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

