A set of MATlab/Octave scripts have been developed, which output state matrices describing the linearized aerolastic dynamics of an offshore wind turbine. The aerodynamic model is based on momentum balance,and includes time-lag models for dynamic inflow, circulation lag, and dynamic stall. The structural model is a multibody formulation with modal reduction applied to the foundation/tower, nacelle, driveshaft and each of three blades. At present the model is set up for a monopile foundation,although the methods are also applied applicable to other types of foundations. The seabed properties are represented by springs and dampers distributed along the foundation. Hydrodynamic added mass is includes. The model has been verified by comparison of natural frequencies, damping ratios, and transfer functions against results obtained using other programs.