You'll use MATLAB the way engineers actually use it — to model real systems, run real experiments, and check your answers against real data. Along the way, you'll uncover why computers sometimes get arithmetic "wrong," and what that means for the systems we trust with our lives.
You'll learn the MATLAB environment by actually using it — not by reading about it. Each lesson starts with a problem that you genuinely can't solve yet. Then we build the tool you need to solve it.
You don't need to know any MATLAB. But pause for a moment and think about what you do know:
Research on learning shows that connecting new ideas to what you already know is the fastest path to deep understanding (Ambrose et al., 2010). That's why we start here.
You need to solve 500 equations. Writing them out by hand will take hours. What if there were a workspace that did the bookkeeping for you?
You need to store the voltage measurements from 1,000 sensors. Making 1,000 individual variables is absurd. What's the better way?
1:10) to generate sequences and linspace to make evenly-spaced grids. You'll see why element-wise operations (.*) are different from matrix operations (*).A * B and A .* B?When you use linspace(0,1,100), you're assuming the quantity you're modeling is continuous. Is that always true? What if it's discrete?
You have sensor readings from a circuit. You only want the ones above a safety threshold. How do you filter 10,000 numbers down to just the ones that matter?
readings > 3.0 return on its own?& (element-wise AND) and && (short-circuit AND)?Your code needs to behave differently depending on the situation — apply one formula for a resistor, a different one for a capacitor. How do you teach a program to make decisions?
if/elseif/else blocks that branch on conditions, for loops that repeat over arrays, and while loops that keep going until a condition changes. The key insight: loops are powerful but slow. By the end of Unit 1, you'll know when to use a loop — and when to avoid one entirely.while loop make more sense than a for loop?while loop condition is never false? What do you do?You've written the same resistance calculation three times in three different scripts. When you find a mistake, you'll have to fix it in three places. There's a better way.
.m function files, pass in inputs, and get outputs back. You'll learn about local scope — why a variable inside a function can't accidentally overwrite one outside. Functions are the building blocks of every large engineering project.You've got a big project coming. How do you break a complex problem into pieces you can actually code — and then put them back together?
For each solution you build, try representing it in at least 3 of these 5 forms. This deepens your understanding significantly.
resistance() function look like?The Electrify Linear-Systems Problem (ELSP) is the centerpiece of the course. You'll build a physical resistor circuit, measure voltages and currents yourself, model it as a linear system, solve it with MATLAB, and compare your computed answers against your measured data.
A circuit is just a system of equations. Kirchhoff's laws give you the equations; MATLAB solves them. But here's what makes this project real: you'll collect the measured data yourself, and you'll find out whether your model is right.
This is the verification principle in action — you can check your own work without asking the instructor if your answer is correct. The circuit tells you.
Ax = bx = A\bResistors follow Ohm's Law exactly. Temperature doesn't change resistance. Wires have zero resistance. Measurement instruments are perfect. Which of these is most likely to be wrong? How could you test that?
Modeling is not a one-shot activity. Engineers revise their models many times. Your first attempt is supposed to be imperfect. That's the point.
Ax = bAx = b. Solve with MATLAB's backslash operator. Then write a function that automates this for any circuit of the same topology.A\b preferred over inv(A)*b in MATLAB?Your model will not be perfect. That's expected. The question to answer: is the error small enough to be useful? For what applications would this model be "good enough"?
This unit answers a question most programmers never ask: how does a computer actually store the number 0.1? The answer is stranger — and more important — than you think. If you write code that involves money, navigation, or medical data, you need to know this.
In this unit, you'll understand exactly why that last one happens — and how to protect your code from it.
You have 8 light switches. Each is either ON (1) or OFF (0). How many different combinations can you make? And what numbers can you represent that way?
uint8 variable can only hold values 0–255. You'll also see what happens when you go one higher than 255 — overflow — and why that matters.dec2bin(42)You need to represent negative numbers in binary. You can't just add a minus sign — computers only have 0s and 1s. How do you encode the idea of "negative"?
int8 goes from −128 to +127 (not −127 to +127), and see how subtraction becomes addition in binary — which is why it's such an elegant solution.Integers can't represent 3.14. Floating-point numbers are slow on cheap hardware. What do you do when you need decimals but you're programming a small sensor with limited compute power?
ufixed data type works, understand the trade-off between range and precision, and learn why GPS chips and audio processors often use fixed-point math.You're assuming your numbers will always stay within a known range. If they don't, you get overflow. Is that assumption safe for the application you're building?
Try this in MATLAB: 0.1 + 0.2 == 0.3. You'll get false. Why? And should you be worried?
== on floating-point numbers is almost always a mistake.eps) and what does it measure?Before 1985, every computer manufacturer stored floating-point numbers differently. Code from one machine wouldn't give the same answers on another. Scientists couldn't reproduce each other's results. How did we fix this?
double (1 sign bit, 11 exponent bits, 52 mantissa bits), understand special values like Inf, -Inf, and NaN, and use an online IEEE 754 calculator to explore edge cases. This is one of the most important technical standards in computing history.NaN mean and when does it appear?NaN != NaN evaluating to true not a bug, but a feature?You've built a model that gives an answer. But how wrong could that answer be? And does the error grow or shrink as your computation gets bigger?
These strategies come from research on how people actually learn — not from myth or habit.
Every lesson starts with a headache — a problem you can't yet solve. Sit with that discomfort before reaching for the solution. The frustration is productive; it means your brain is building a connection.
After you finish a lesson, close your notes and write down everything you remember. This feels harder than rereading, but research consistently shows it produces stronger, longer-lasting memory (Roediger & Karpicke, 2006).
Take working code and deliberately change something to see what breaks. Ask: "what if I remove the semicolon? What if this array is empty?" Breaking things teaches you the boundaries of your understanding.
Pseudocode and flowcharts aren't busywork — they're thinking on paper. Students who write out their plan first write better code faster, because they've already solved the logic problem before the syntax gets in the way.
Motivation isn't something you wait to feel — it's something you build. After each lesson, write one sentence: "This connects to [something in my life] because..." The more specific, the more powerful.
Your Learning Portfolio isn't a scrapbook of completed work. It's a record of your thinking over time. Include what confused you, what you tried that didn't work, and what changed your mind. That's what real learning looks like.
These aren't grades — they're descriptions of what you can do. Use them to understand where you are and where you're headed.
You can navigate the MATLAB desktop, create arrays, use logical indexing, write control flow, and call functions. You can solve a small problem from scratch in a Live Script.
You built a physical circuit, collected your own data, set up a linear system, solved it with MATLAB, and compared computed to measured. You explained the discrepancy in writing.
You can explain why 0.1 + 0.2 ≠ 0.3 in binary. You understand overflow, two's complement, fixed-point trade-offs, and IEEE 754. You can measure and reason about floating-point error in your own code.