draw line graphs connecting two points

Hi,
I want to draw somthing like this. Can I know how to connect two points? thanks.

답변 (1개)

Chunru
Chunru 2021년 7월 24일
편집: Chunru 2021년 7월 24일

0 개 추천

% Fisrt specify the coordinates
pstart = [ones(1,5); (1:5)]
pstart = 2×5
1 1 1 1 1 1 2 3 4 5
pend = [ones(1,5)+5; (1:5)+9]
pend = 2×5
6 6 6 6 6 10 11 12 13 14
% plot the lines
plot([pstart(1,:); pend(1,:)], [pstart(2,:); pend(2,:)])

카테고리

도움말 센터File Exchange에서 Networks에 대해 자세히 알아보기

태그

질문:

HYZ
2021년 7월 24일

편집:

2021년 7월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by