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_nurbs_volume.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 NURBS volume that is specified by the knot
%  vectors of degrees p1, p2, p3 and the nodes (control points) in 3D.
%  
%  
%  Warning:
%  
%  The knot vector is assumed to be open. The nodes are assumed to be
%  ordered along the direction of 1, then along that of 2, then along
%  that of 3
    
function draw_nurbs_volume(knots1, knots2, knots3, nodes, p1, p2, p3)
    % Some useful constants
    constant_p1p1 = p1 + 1;
    constant_p2p1 = p2 + 1;
    constant_p3p1 = p3 + 1;
    
    numKnots1 = size(knots1, 1);
    numKnots2 = size(knots2, 1);
    numKnots3 = size(knots3, 1);
    numNodes1 = numKnots1 - constant_p1p1;
    numNodes2 = numKnots2 - constant_p2p1;
    numNodes3 = numKnots3 - constant_p3p1;
    numNodes = numNodes1 * numNodes2 * numNodes3;
    numDimensions = size(nodes, 2) - 1;
    
    % Check for errors
    if (numNodes ~= size(nodes, 1))
        fprintf('Error: For the given knot vectors, there should be %d nodes.\n\n', numNodes);
        
        return;
        
    elseif (numDimensions ~= 3)
        fprintf('Error: The nodes must be in the 3D space.\n\n');
        
        return;
        
    end