plotting the trajectories of three particles in same graph
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ls
am 10 Aug. 2021
Kommentiert: Image Analyst
am 10 Aug. 2021
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 Kommentare
Akzeptierte Antwort
Image Analyst
am 10 Aug. 2021
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 Kommentare
Image Analyst
am 10 Aug. 2021
If x and y are parameterized variables depending on t, then the first code snippet I sent you will work.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!