TL;DR: Start from my template on GitHub, then read the style guide below.
Last updated October 2026. I first wrote this post in 2021 around the physics package. That package hasn’t been updated since 2012 and has some known pitfalls, so I now recommend two maintained replacements: physics2 (delimiters, bra–ket notation, matrices) and derivative (derivatives and differentials).
Use these instead: MathWorks’ Phase Plane and Slope Field apps. I’m happy to report that my work here has been rendered obsolete. Brian Hong at MathWorks has written new programs that are sleek, modern, documented, and in every way superior. The rest of this post describes my 2021 update of the old programs and is kept for the record.
Written in January 2021. Several of the tools below have changed since then, and the best option for MATLAB users is now MathWorks’ Phase Plane and Slope Field apps.