h=pplot(p,[c,w])
p : | Point or list of points to be plotted 2xn or 3xn | |
c : | Color and symbol of points | |
w : | width of the used line |
h : | Handle to figure |
Input Parameters:
Output:
Algorithm Steps:
p
has exactly 2 elements. If so, convert it to a 3-element column vector by appending a zero: p = [p(1); p(2); 0]
.p
is a 2xn matrix, convert it to a 3xn matrix by appending a row of zeros: p = [p; zeros(size(p,2),1)']
.c
to 'r*-' if not provided.w
to 1 if not provided.plot3
function to create a 3D plot of the points in p
:w
is 1, call plot3(p(1,:), p(2,:), p(3,:), c)
.w
is not 1, call plot3(p(1,:), p(2,:), p(3,:), c, 'LineWidth', w)
.h
to the created plot.