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

6 次查看(过去 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 个评论

请先登录,再进行评论。

类别

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