A lot of information is available at the MathWorks website.

There is a nice set of pages maintained at Portland State University.


And here’s my bit of stuff that may help.

A Matlab m-file is a file with extension ".m" that Matlab can execute. There are two types of m-files: script files and function files.

Matlab Exercises

This file contains basic exercises to help you become familiar with Matlab's features.

Rotation matrices

 The file rotex.m is a script file that computes some example rotation matrices. It uses the function files R1.m, R2.m, and R3.m. These three files compute the simple rotation matrices associated with "1", "2", and "3" rotations, respectively.

You should download these 4 files, put them in your Matlab directory, and type rotex at the Matlab prompt to see how it works.

Position and velocity <-> Orbital elements

 The file rv2oeex.m is a script file that does the calculations for a specific problem of converting position and velocity vectors to orbital elements. It calls two Matlab functions rv2oe.m and oe2rv.m to convert between position and velocity and orbital elements. In these functions, oe is a 6x1 matrix containing the semimajor axis, eccentricity, inclination, argument of periapsis, right ascension of the ascending node, and true anomaly (at epoch). A variation on oe2rv.m is oee2rv.m. The difference is that the 6th orbital element in the oee2rv version is eccentric anomaly at epoch instead of true anomaly.

SEZ coordinates -> Position and velocity

 The file razel2rv.m is a Matlab function that converts rho, rhodot, Az, Azdot, El, and Eldot to position and velocity vectors in the IJK frame. You do need to know local sidereal time, Earth rotation rate (relative to inertial space), site latitude, and Earth radius.

The file razelex.m is a Matlab script file that does an example, including making a plot of the three-dimensional trajectory intersecting a sphere.