The Newmark-beta method can be used to solve structural dynamics problems in the time domain, of the form:

M (d^2x/dt^2) + C dx/dt + K x = F

This method performs direct integration on the mass, damping and stiffness matrices which may be fully-coupled.

The following Matlab script that performs this calculation for enforced acceleration. It may also be used for base acceleration excitation

The main script is:
mdof_enforced_acceleration_nm.m
The remaining scripts are supporting function.
- Tom Irvine