You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: draw_bspline_curve.m
    path of file: ./repos/Isogeometric-Analysis/routines_for_iga
    
    the code of the file until where you have to start completion: %--------------------------------------------------------------------------
%  Author: Isaac J. Lee (ijlee2@ices.utexas.edu)
%  
%  
%  Summary:
%  
%  This routine draws the B-spline curve that is specified by the knot
%  vector of degree p and the nodes (control points) in 1D, 2D, or 3D.
%  
%  
%  Warning:
%  
%  The knot vector is assumed to be open. The nodes are assumed to be
%  ordered along the direction of 1.
%  
%  
%  Instructions:
%  
%  Type the following onto Matlab's command window or in a code,
%  
%      draw_
    
function draw_bspline_curve(knots, nodes, p)
    % Some useful constants
    constant_pp1 = p + 1;
    
    numKnots = size(knots, 1);
    numNodes = numKnots - constant_pp1;
    numDimensions = size(nodes, 2);
    
    % Check for errors
    if (numNodes ~= size(nodes, 1))
        fprintf('Error: For the given knot vector, there should be %d nodes.\n\n', numNodes);
        
        return;
        
    elseif (numDimensions < 1 || numDimensions > 3)
        fprintf('Error: The nodes must be in the 1D, 2D, or 3D space.\n\n');
        
        return;
        
    end