필터 지우기
필터 지우기

How can I draw a line with two points x1, y1 and x2, y2 and assign weight to the edge.

조회 수: 4 (최근 30일)
How can I draw a line with two points (x1, y1) and (x2, y2) and assign weight to the edge.
Thanks in advance.
  댓글 수: 4

댓글을 달려면 로그인하십시오.

답변 (1개)

Scott MacKenzie
Scott MacKenzie 2022년 3월 10일
편집: Scott MacKenzie 2022년 3월 10일
x1 = 0; x2 = 1;
y1 = 0; y2 = 1;
line([x1 x2], [y1 y2], 'linewidth', 5);
text(0.45, 0.55, '10', 'FontSize', 14);
  댓글 수: 3
Scott MacKenzie
Scott MacKenzie 2022년 3월 10일
By "weight", it seems you mean a label. I just added this to the code.

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by