Matlab functions fix, small dynamic fix

Matlab functions will write all the unknown constants as global,
In the dynamic model the computation parts of DDM and Inertia matrix
were separeted from the interface functions