1. Operating System Recommendations
Students will be provided support irrespective of the OS they choose. However, you are strongly encouraged to use a Linux or Unix-based operating system such as macOS or Ubuntu.
For Windows Users
Windows users can (and should) make use of WSL2 (Windows Subsystem for Linux 2). This will provide you with a full Linux environment within Windows.
Resources:
Official WSL2 Installation Guide
WSL2 Troubleshooting Guide
2. Required Software and Editors
This course will provide support for two programming languages:
- MATLAB
- Python
Code Editor
Visual Studio Code (VS Code) will be the standard editor for this course.
- Encouraged: Students are encouraged to learn and use terminal-based editors such as VIM and Nano
- Discouraged: Students are strongly discouraged from using software alternatives
that do not add to your quiver of marketable skills, such as:
- Microsoft Excel for computational work
- Notepad for code editing
- Other non-professional development tools
3. MATLAB Setup Instructions
3.1 Obtaining MATLAB
UCI offers MATLAB licenses to all students. You can download the latest version of MATLAB from MathWorks by using your UCI credentials.
- Visit the MathWorks website
- Sign in or create an account using your UCI email address (@uci.edu)
- Download and install MATLAB for your operating system
3.2 Performance Optimization for Lower-Spec Systems
Important Note: The MATLAB GUI is extremely bloated and resource-intensive. If your PC has lower-quality specs, running MATLAB in GUI mode will drastically reduce your system's performance.
Solution: Run MATLAB in terminal mode and use the VS Code extension for editing.
3.3 Setting Up MATLAB Terminal Mode
For macOS Users:
Step 1: Create an alias in your shell configuration file
- Open Terminal
- Determine your shell (usually zsh on modern macOS):
echo $SHELL - Edit your shell configuration file:
- For zsh (default):
nano ~/.zshrc - For bash:
nano ~/.bash_profile
- For zsh (default):
- Add the following alias (adjust MATLAB version as needed):
alias matlab="/Applications/MATLAB_R2024b.app/bin/matlab -nodesktop -nosplash" - Save the file (Ctrl+O, Enter, Ctrl+X in nano)
- Reload your shell configuration:
source ~/.zshrc # or source ~/.bash_profile - Test the alias by typing
matlabin your terminal
For Linux/Ubuntu Users:
- Open Terminal
- Edit your bash configuration:
nano ~/.bashrc - Add the following alias (adjust path and version as needed):
alias matlab="/usr/local/MATLAB/R2024b/bin/matlab -nodesktop -nosplash" - Save and reload:
source ~/.bashrc - Test the alias by typing
matlabin your terminal
For Windows Users (WSL2):
- Install MATLAB in your WSL2 Linux environment (or use Windows installation)
- If using Windows MATLAB from WSL2, edit
~/.bashrc:nano ~/.bashrc - Add the alias (adjust path for your Windows installation):
alias matlab="/mnt/c/Program\ Files/MATLAB/R2024b/bin/matlab.exe -nodesktop -nosplash" - Save and reload:
source ~/.bashrc
For Native Windows (Command Prompt/PowerShell):
For PowerShell:
- Open PowerShell
- Edit your PowerShell profile:
(If file doesn't exist, create it:notepad $PROFILENew-Item -Path $PROFILE -Type File -Force) - Add the following function:
function matlab { & "C:\Program Files\MATLAB\R2024b\bin\matlab.exe" -nodesktop -nosplash } - Save and restart PowerShell
3.4 VS Code MATLAB Extension
- Open VS Code
- Go to Extensions (Ctrl+Shift+X or Cmd+Shift+X)
- Search for "MATLAB" by MathWorks
- Install the extension
- Configure the extension to point to your MATLAB installation
- Now you can edit MATLAB files in VS Code and run them in the terminal
4. Python Setup Instructions
4.1 Understanding Virtual Environments
A virtual environment is an isolated Python environment that allows you to install packages and dependencies specific to a project without affecting your system-wide Python installation. This is crucial for:
- Dependency Management: Different projects can require different versions of the same package
- Reproducibility: Ensures your code works the same way on different machines
- Clean Environment: Keeps your system Python installation clean and organized
4.2 Setting Up Your Course Environment
Step 1: Create a Course Folder
First, create a dedicated folder for this course. As the course progresses, you can create additional subfolders for different projects.
# Navigate to your preferred location (e.g., Documents)
cd ~/Documents
# Create the course folder
mkdir MAE159
cd MAE159
Step 2: Create a Virtual Environment
For macOS/Linux/WSL2:
# Create virtual environment named 'venv'
python3 -m venv venv
# Activate the virtual environment
source venv/bin/activate
For Windows (Command Prompt):
# Create virtual environment
python -m venv venv
# Activate the virtual environment
venv\Scripts\activate
For Windows (PowerShell):
# Create virtual environment
python -m venv venv
# Activate the virtual environment
venv\Scripts\Activate.ps1
Note: When the virtual environment is activated, you should see (venv)
at the beginning of your terminal prompt. This indicates that you're working within the virtual environment.
Step 3: Install Required Libraries
With your virtual environment activated, install the essential scientific computing libraries:
# Upgrade pip (Python package installer)
pip install --upgrade pip
# Install essential scientific computing packages
pip install numpy pandas scipy matplotlib
# Optional but recommended packages
pip install jupyter notebook ipython seaborn scikit-learn
Step 4: Verify Installation
Test that everything is installed correctly:
# Start Python
python
# In the Python interpreter, test imports:
>>> import numpy as np
>>> import pandas as pd
>>> import scipy
>>> import matplotlib.pyplot as plt
>>> print("All packages imported successfully!")
>>> exit()
4.3 Daily Workflow
Every time you work on your course projects:
- Navigate to your course folder:
cd ~/Documents/MAE159 - Activate the virtual environment:
source venv/bin/activate(or appropriate command for your OS) - Work on your projects
- When done, deactivate:
deactivate
4.4 VS Code Python Setup
- Open VS Code
- Install the Python extension by Microsoft
- Open your MAE159 folder in VS Code
- Press Ctrl+Shift+P (Cmd+Shift+P on Mac) and search for "Python: Select Interpreter"
- Select the interpreter from your venv folder (should show something like
./venv/bin/python) - VS Code will now automatically use your virtual environment
If you encounter any issues during setup, please reach out for an office hours appointment or post on the course forum.