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: polyInterpolationCore.m
    path of file: ./repos/LADAC/control/trajectory/spline_functions
    
    the code of the file until where you have to start completion: function [x, i] = polyInterpolationCore(points, degree, cycle)
%polyInterpolation computes stepwise interpolated functions in 1D
%   The function calculates stepwise defined polynomials for any degree.

    
function [x, i] = polyInterpolationCore(points, degree, cycle)
%polyInterpolation computes stepwise interpolated functions in 1D
%   The function calculates stepwise defined polynomials for any degree.
%   The values are given are assumed to be equally spaced with a constant
%   stepsize.
%
%   Note:
%   This is a very specialized function for polynominal interpolation.
%   This function is not intend