Plotting few lines using one matrix

3 vues (au cours des 30 derniers jours)
Maor Levy
Maor Levy le 30 Avr 2013
Let's say I have two matrices x and y
x = [1 2 3 1 2] y = [1 2 3 1 3]
I want to plot two lines from it, first three points and then two last points.
In the end I want to get this plot. Can I do it with Matlab?

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 30 Avr 2013
plot(x(1:3),y(1:3))
hold all
plot(x(4:5),y(4:5))

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by