| New Reply |
Draw Lines between Points in MATLAB |
Share Thread | Thread Tools |
| Apr14-11, 06:54 PM | #1 |
|
|
Draw Lines between Points in MATLAB
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 |
| Apr14-11, 07:41 PM | #2 |
|
|
plot(V(:,1),V(:,2)) should do it, if I remember my matrix slicing.
|
| Apr14-11, 07:45 PM | #3 |
|
|
Thanks |
| Apr14-11, 07:50 PM | #4 |
|
|
Draw Lines between Points in MATLAB
It only plots three points?
![]() I think you should be able to get a connected graph by appending the start point onto the matrix (getting a 6x2) and then using plot. |
| Apr14-11, 08:02 PM | #5 |
|
|
|
| Apr14-11, 08:16 PM | #6 |
|
|
Glad to hear it.
|
| Apr14-11, 08:17 PM | #7 |
|
|
|
| Apr14-11, 08:20 PM | #8 |
|
|
You should probably be able to do something similar with plot3() for lines in R3.
|
| Apr14-11, 10:47 PM | #9 |
|
|
|
| Apr14-11, 10:58 PM | #10 |
|
|
|
| Apr14-11, 11:01 PM | #11 |
|
|
Thanks |
| Apr14-11, 11:24 PM | #12 |
|
|
You may have to break the matrix up into matrices such that plot3 will produce the lines connected the way you want.
Another option is to look on the file exchange and see if there's anything you can use there. http://www.mathworks.com/matlabcentral/fileexchange/ |
| Apr15-11, 11:09 AM | #13 |
|
|
|
| Apr15-11, 02:55 PM | #14 |
|
|
I think there may be a file on the exchange that will do what you want, otherwise I'm afraid I don't know of a built in function that will do what you want on only one call.
|
| New Reply |
| Thread Tools | |
Similar Threads for: Draw Lines between Points in MATLAB
|
||||
| Thread | Forum | Replies | ||
| draw a simpl graph in matlab | Math & Science Software | 2 | ||
| Points, Lines, and Planes in 3D Space! Given 3 points find a plane... | Calculus & Beyond Homework | 10 | ||
| How can I draw graphs for the equation on matlab | Math & Science Software | 1 | ||
| points and lines | Introductory Physics Homework | 1 | ||
| Two lines intersect at three points??? | General Math | 2 | ||