plotting the trajectories of three particles in same graph
조회 수: 3 (최근 30일)
이전 댓글 표시
I have three particles with x and y values of each particle, I neet to plot all three trajectories in same graph. How can I do it?
댓글 수: 0
채택된 답변
Image Analyst
2021년 8월 10일
Try this:
plot(x1, y1, 'r-', 'LineWidth', 3);
hold on;
plot(x2, y2, 'g-', 'LineWidth', 3);
plot(x3, y3, 'b-', 'LineWidth', 3);
grid on;
xlabel('x', 'FontSize', fontSize);
ylabel('y', 'FontSize', fontSize);
title('Demo by Image Analyst', 'FontSize', fontSize);
legend('y1', 'y2', 'y3');
댓글 수: 4
Image Analyst
2021년 8월 10일
If x and y are parameterized variables depending on t, then the first code snippet I sent you will work.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!