필터 지우기
필터 지우기

How to connect the multi scatter?

조회 수: 1 (최근 30일)
Hang Vu
Hang Vu 2019년 5월 20일
댓글: Star Strider 2019년 5월 21일
I want to connect pone in a line follow the for loop, the same for ptwo. And suppose that I have 2 first points. This is my code:
for p=1:10
pone=randi(10,1);
ptwo=randi(10,1);
plot(p,pone,'r.',p,ptwo,'c*','MarkerSize',10)
hold on
axis([0 5 0 20])
end
hold off

채택된 답변

Star Strider
Star Strider 2019년 5월 20일
I am not certain what reault you want.
Try this:
p=1:10;
pone=randi(10,1,numel(p));
ptwo=randi(10,1,numel(p));
plot(p,pone,'r.-',p,ptwo,'c*-','MarkerSize',10)
axis([0 5 0 20])
  댓글 수: 4
Hang Vu
Hang Vu 2019년 5월 21일
Thank you so much!^^
Star Strider
Star Strider 2019년 5월 21일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by