How to plot lines between all these points

1 次查看(过去 30 天)
Hi,
I have a matrix V, which is a 5-by-2 matrix, where each row represents a point in the xy-plain. How can I connect these points together in MATLAB, please?
Thanks in advance

采纳的回答

Matt Fig
Matt Fig 2011-4-15
Does this do what you need?
V(6,:) = V(1,:); % To connect at the end. Assumes size(V,1) = 5;
line(V(:,1),V(:,2))
  4 个评论
Matt Fig
Matt Fig 2011-4-15
V(6,:) = V(1,:);
line(V(:,1),V(:,2),V(:,3))
S. David
S. David 2011-4-15
This did not work, I just got two crossed lines in 2D. Why?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by