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: edit.m
    path of file: ./repos/robotics-toolbox-matlab/@SerialLink
    
    the code of the file until where you have to start completion:         %SerialLink.edit Edit kinematic and dynamic parameters
        %
        % R.edit displays the kinematic parameters of the robot as an editable
        % table in a new figure.
        %
        % R.edit('dyn') as above but also includes the dynamic parameters in the table.
        %
        % Notes::
 
    
function edit_save(button, event, table)
            
            dh = get(table, 'Data');
            r = get(table, 'UserData');
            
            % put the parameters back into the Link objects
            for j=1:r.n
                L = r.links(j);
               
                %dh(j,1) = L.theta;
                L.d = dh(j,2);
                L.a = dh(j,3); 
                L.alpha = dh(j,4);
                if dh(j,5) > 0
                    L.jointtype = 'P';
                else
                    L.jointtype = 'R';
                end