필터 지우기
필터 지우기

plotting the trajectories of three particles in same graph

조회 수: 3 (최근 30일)
Ls
Ls 2021년 8월 10일
댓글: Image Analyst 2021년 8월 10일
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?

채택된 답변

Image Analyst
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
Ls
Ls 2021년 8월 10일
Its variable t and with respect to t there is variable x and y for each three particle.
Image Analyst
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개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by