EE263: Introduction to Linear Dynamical Systems

Sanjay Lall, Stanford University, Fall Quarter 2023

Julia

In this course we will use the language Julia, which is well-suited for working with linear algebra. You will need to have Julia installed on your own computer (do not use a web version of julia.)

There are several sources for introductory material on Julia. We recommend

Some useful code

  • qr.jl Calling the Julia qr function returns matrices which are encoded in special data structures for efficiency. This is a little wrapper than converts the output into standard matrices.

Important features in Julia

You are welcome to ask questions about Julia on Ed and in office hours. Below, we have collected some Julia tricks and tips that you might need.

  • Installing a Julia package (local installation). To install a Julia package, you simply use Pkg.add(…). For example, to install the data formatting library JSON you issue the command Pkg.add(“JSON”). Yes, the quotes are necessary.

  • Using a Julia package. Once you are sure that a package has been installed, you can use a package in Julia script or notebook with the using command. For example, to use the JSON library, you issue the command using JSON.

  • Including helper code. For many assignments, we will give you helper code in the form of a Julia (.jl) file. To use this code in your scripts and notebook, use the include(“filename.jl”) command. It is always helpful to read the provided Julia file, as we will often include helpful comments about the usage of our pre-defined functions.