Plotting few lines using one matrix

조회 수: 8 (최근 30일)
Maor Levy
Maor Levy 2013년 4월 30일
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?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 4월 30일
plot(x(1:3),y(1:3))
hold all
plot(x(4:5),y(4:5))

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by