% Octave/Matlab commands to draw a Bezier curve on 4 control points % % M.V.Wickerhauser % 2019-10-11 P0= [1,1]; P1= [1,3]; P2= [3,2]; P3= [2,1]; points = [P0; P1; P2; P3]; % Four control points for a cubic curve drawBezierCurve(points); hold on plot(P0(1),P0(2),'go'); plot(P1(1),P1(2),'bs'); plot(P2(1),P2(2),'ks'); plot(P3(1),P3(2),'ro'); h = drawBezierCurve(points, 'discretization', 6, 'color','r'); hold off