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: autoGen_dynamics.m
    path of file: ./repos/OptimTraj/demo/simpleWalker
    
    the code of the file until where you have to start completion: function [ddq1,ddq2] = autoGen_dynamics(q1,q2,dq1,dq2,u,d,m,I,g,l)
%AUTOGEN_DYNAMICS
%    [DDQ1,DDQ2] = AUTOGEN_DYNAMICS(Q1,Q2,DQ1,DQ2,U,D,M,I,G,L)

%    This function was generated by the Symbolic Math Toolbox version 6.2.
%    07-Sep-2015 19:06:39

t2 = d.^2;
t3 = m.^2;
t4 = l.^2;
t5 = q1-q2;
t6 = sin(q1);

    
function [ddq1,ddq2] = autoGen_dynamics(q1,q2,dq1,dq2,u,d,m,I,g,l)
%AUTOGEN_DYNAMICS
%    [DDQ1,DDQ2] = AUTOGEN_DYNAMICS(Q1,Q2,DQ1,DQ2,U,D,M,I,G,L)

%    This function was generated by the Symbolic Math Toolbox version 6.2.
%    07-Sep-2015 19:06:39

t2 = d.^2;
t3 = m.^2;
t4 = l.^2;
t5 = q1-q2;
t6 = sin(q1);
t7 = q1.*2.0;
t18 = q2.*2.0;
t8 = t7-t18;
t9 = dq2.^2;
t10 = sin(t5);
t11 = I.^2;
t12 = t11.*2.0;
t13 = t2.^2;
t14 = t3.*t13.*2.0;
t15 = t2.*t3.*t4.*3.0;
t16 = I.*m.*t2.*4.0;
t17 = I.*m.*t4.*4.0;
t19 = cos(t8);
t20 = t12+t14+t15+t16+t17-d.*l.*t2.*t3.*4.0-t2.*t3.*t4.*t19-I.*d.*l.*m.*4.0;
t21 = 1.0./t20;
t22 = cos(t5);
t23 = d.*l.*m.*t22.*u.*2.0;
t24 = dq1.^2;
t25 = -q2+t7;
t26 = sin(t25);
t27 = sin(q2);
t28 = sin(t8);
ddq1 = t21.*(t23-I.*u.*2.0-m.*t2.*u.*2.0+g.*l.*t2.*t3.*sin(q1-q2.*2.0)-I.*d.*g.*m.*t6.*2.0+I.*g.*l.*m.*t6.*4.0-d.*g.*t2.*t3.*t6.*2.0+g.*l.*t2.*t3.*t6.*3.0-t2.*t3.*t4.*t24.*t28+I.*d.*l.*m.*t9.*t10.*2.0+d.*l.*t2.*t3.*t9.*t10.*2.0);
if nargout > 1
    ddq2 = -t21.*(t23-I.*u.*2.0-m.*t2.*u.*2.0-m.*t4.*u.*4.0+d.*l.*m.*u.*4.0+I.*d.*g.*m.*t27.*2.0+d.*g.*t2.*t3.*t27.*2.0-d.*g.*t3.*t4.*t26.*2.0+d.*g.*t3.*t4.*t27.*2.0+g.*l.*t2.*t3.*t26-g.*l.*t2.*t3.*t27.*3.0-t2.*t3.*t4.*t10.*t24.*4.0-t2.*t3.*t4.*t9.*t28+I.*d.*l.*m.*t10.*t24.*2.0+d.*l.*t2.*t3.*t10.*t24.*2.0+d.*l.*t3.*t4.*t10.*t24.*4.0);
end