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: polylinelen.m
    path of file: ./repos/iso2mesh
    
    the code of the file until where you have to start completion: function [len, node, inputreversed]=polylinelen(node, p0, p1, pmid)
%
% [len, node, inputreversed]=polylinelen(node, p0, p1, pmid)

    
function [len, node, inputreversed]=polylinelen(node, p0, p1, pmid)
%
% [len, node, inputreversed]=polylinelen(node, p0, p1, pmid)
%
% Calculate the polyline line segment length vector in sequential order
%
% author: Qianqian Fang (q.fang at neu.edu)
%
% input:
%    node: an N x 3 array defining each vertex of the polyline in
%          sequential order
%    p0:(optional) a given node to define the start of the polyline, if not
%         defined, start position is assumed to be 1st node
%    p1:(optional) a given node to define the end