Loops and Applications

Dong Zhou, California State University-Los Angeles, Mathematics
Author Profile
Initial Publication Date: October 22, 2023

Summary

This is a lecture that introduces students to loops in MATLAB (for, while) and some applications (calculating a finite series, creating animation with loops). In the after class assignment, students are asked to write a short MATLAB code to calculate 50 iterations of the discrete logistic equation. In this assignment, students are also guided to explore the solution behavior for different parameter values.

Share your modifications and improvements to this activity through the Community Contribution Tool »

Learning Goals

1. Students should learn the basic structure of loops.
2. This is an introductory course to MATLAB programming.
3. Students will need to turn a mathematical problem into an algorithm.

Context for Use

1. This is a lower division course for Math majors. Prerequisite: Calculus I.
2. This is a lecture notes including in-class activities.
3. This lecture is in Week 6 of this introductory course to MATLAB programming. Students have basic knowledge in MATLAB.

Description and Teaching Materials

This is a lecture that introduces students to loops in MATLAB (for, while) and some applications (calculating a finite series, creating animation with loops). In the after class assignment, students are asked to write a short MATLAB code to calculate 50 iterations of the discrete logistic equation. In this assignment, students are also guided to explore the solution behavior for different parameter values.
lecture notes on Loops with activity (MATLAB Live Script 126kB Oct22 23)
Assignment on Loops (Acrobat (PDF) 125kB Oct22 23)


Teaching Notes and Tips


Assessment

References and Resources

Programming with MATLAB for Scientists. A Beginner's Introduction
By Eugeniy E. Mikhailov

This teaching activity was created as a part of the Teaching Computation with MATLAB Workshop held in 2023 at Carleton College.