How to connect the multi scatter?

1 Ansicht (letzte 30 Tage)
Hang Vu
Hang Vu am 20 Mai 2019
Kommentiert: Star Strider am 21 Mai 2019
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

Akzeptierte Antwort

Star Strider
Star Strider am 20 Mai 2019
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 Kommentare
Hang Vu
Hang Vu am 21 Mai 2019
Thank you so much!^^
Star Strider
Star Strider am 21 Mai 2019
As always, my pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by