How can I join points with line

3 vues (au cours des 30 derniers jours)
Tanvir Hossain
Tanvir Hossain le 13 Jan 2020
Commenté : darova le 16 Jan 2020
I've 4 points. I want to join first two of the with a line and then second two with another line
My desired picture is given below
Untitled.png
I can draw the first graph with maker. but but I want to join these points.
Thanks in advance

Réponse acceptée

Adam Danz
Adam Danz le 13 Jan 2020
Use matrix inputs. A line is drawn for each column of inputs. The first matrix defines the x values, the 2nd matrix defines the y values.
plot([0 1; 1.5 3],[1 2; 5 6], 'r-o')
  1 commentaire
darova
darova le 16 Jan 2020
please accept my answer too

Connectez-vous pour commenter.

Plus de réponses (1)

darova
darova le 13 Jan 2020
Try to reshape data
a1 = reshape(a,[],2);
b1 = reshape(b,[],2);
plot(a1,b1)
% plot(a1',b1') % another variant

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by