Technical Articles

Creating a Self-Paced, Online Version of a Classroom-Based Introductory MATLAB Course

By Dr. Aaron Drews, University of California, San Diego

CENG 15: Engineering Computation Using MATLAB is a requirement for all incoming first-year students in chemical engineering and nanoengineering at UC San Diego. Students learn to solve engineering problems using computational methods and acquire proficiency in skills they will need throughout their studies, such as formulating problem statements, developing algorithms, and analyzing results in MATLAB®.

When I created an online version of the course, my main goal was to improve the students’ learning experience. Now offered in parallel with the in-class version, the online version has proved to be a popular and successful addition to the program. Students who take it perform as well as their peers on comparable assignments while enjoying the flexibility to complete the coursework wherever and whenever works best for their schedule.  

From the Lecture Hall to Self-Paced, Online Learning

CENG 15 was originally taught in a standard lecture format, with students listening passively as the professor introduced new concepts on a chalkboard. I felt that students could learn coding concepts much more efficiently if they were able to experiment with the material. When I began teaching the course, I moved it to a computer lab and had students try out plots, vector analyses, simple calculations, scripts, and other tasks and constructs in MATLAB while I was presenting them.

Students come into CENG 15 with vastly different levels of knowledge; some know MATLAB, some can code in another language, and others have no programming experience at all. The diversity of their backgrounds is what makes self-paced learning so important. The self-pacing allows students with experience to move through the material quickly while giving others as much time as they need to grasp new concepts. In addition, students who commute long distances or have jobs off-campus can learn and complete assignments from home at any time of day. 

Preparing the Online Course Content

The online version of CENG 15 was funded by the Innovative Learning Technology Initiative (ILTI), a program established by the UC Office of the President to encourage the use of technology and the development of high-quality online courses. I also received technical support from a team of MathWorks content development engineers. I worked with this team to create instructional materials, including videos and interactive learning modules. These materials were based on lesson plans and assignments from the lab version of the course and on MATLAB tutorials.

We designed the course materials to be modular so that the content could be tailored to the needs of specific programs. The initial set of topics included importing and plotting data, working with tables, programming constructs, functions, statistical methods, linear algebra, nonlinear equations, and ordinary differential equations. Many of the examples used in the videos and quizzes were based on my lecture notes for the in-class version, with the voice-over provided by a MathWorks content development engineer.

How the Module-Based Approach Works Online

Students complete the modules in sequence, typically at a rate of one or two modules each week. We don’t impose an upper limit on how quickly they progress, but we do enforce a lower limit to make sure they finish the class on time.

Each module starts with a short video that introduces the topic and explains its importance. Depending on the complexity of the topic, the student then either watches another short video or jumps into a guided example in MATLAB. The MATLAB examples provide immediate feedback and offer hints for those students who may need them (Figure 1).

Figure 1. A guided example in MATLAB on indexing into vectors, with immediate feedback provided on the student’s answers.

Figure 1. A guided example in MATLAB on indexing into vectors, with immediate feedback provided on the student’s answers.

After passing a short, ungraded quiz in MATLAB to evaluate their understanding of the material, students begin more in-depth coding examples. In the differential equation module, for example, they build up a script to solve a problem one step at a time. First, they simply fill in some initial conditions and run the code provided. Subsequent examples provide less code, until the student is essentially starting with blank script.

Once the students feel they have mastered a particular topic, they take a graded quiz using UC San Diego’s learning management system and then complete a homework assignment in which they apply the concepts they learned to problems tailored to their specific engineering discipline—for example, chemical engineering or nanoengineering.

Final Projects

At the end of the course, each student completes a project designed to incorporate all the material covered. In the final project last year, students developed a simulation of a two-dimensional gas in MATLAB. They had to write a MATLAB script that displayed circles representing particles bouncing around the interior of a square and then perform a statistical analysis on the results of this simulation.

I set up four levels of difficulty: Bronze, Silver, Gold, and Platinum. Students could choose to stop after the Bronze level or complete all four. At the Bronze level, they had to write the code for a single particle moving around and bouncing off the sides of the square. They had to update the particle’s position, determine when it collided with a wall, and then switch its velocity vector based on rules that I provided. At the Silver level, they simulated 81 particles and then plotted the number of wall collisions per unit of time to obtain a rough approximation of the pressure inside the box. At the Gold level, the particles could collide with each other as well as with the walls. At the final Platinum level, there were two different kinds of particles, and with each collision, there was a probability that the particles could undergo a chemical reaction (Figure 2).

Figure 2. MATLAB simulation of a 2D gas in which different particles represented by black and white circles move and collide with one another and with the lines of their bounding container.

Figure 2. MATLAB simulation of a 2D gas in which different particles represented by black and white circles move and collide with one another and with the lines of their bounding container.

The students showed lots of enthusiasm for the project, with more than half choosing to go beyond what was required and attempting the Gold level. Several even completed the Platinum level.

Comparing Course Versions and Planning Next Steps

A comparison of homework assignments submitted by students in each version of the course shows that students in the online course understood the material just as well as their in-class counterparts.

On end-of-class surveys, every student in the online version either agreed or strongly agreed that the online MATLAB training was sufficient for them to complete the homework. About 90% said they would recommend the course—a significant improvement over several years ago, when about 65% said they would recommend the classroom version. The survey responses also showed that the students appreciated the flexibility of the online version.

While it can be tempting for professors to view online courses as a way to save time, I made the decision early on to commit the same amount of time to the online course as I would have to the classroom version. The hours I would have spent in class were instead dedicated to holding office hours and providing feedback. The students noticed that their professor was paying close attention to their homework, and several associated improved learning outcomes with this extra attention. One noted, “I learned much more than I expected in this class. I enjoyed office hours along with the homework that was assigned.” Another commented, “Thank you for all of your detailed feedback and comments on the homework. I've learned a lot from this course.”

The next step is to incorporate the online version of CENG 15 as a core course into other engineering departments at UC San Diego, adding or removing modules as necessary for specific disciplines. After that, we plan to make the course available to students at universities throughout the entire UC system.

UC San Diego is among the 1300 universities worldwide that provide campus-wide access to MATLAB and Simulink. With the Campus-Wide License, researchers, faculty, and students have access to a common configuration of products, at the latest release level, for use anywhere—in the classroom, at home, in the lab, or in the field.

About the Author

Dr. Aaron Drews is an Assistant Teaching Professor of NanoEngineering at The University of California, San Diego. He holds a Ph.D. in chemical engineering from The Pennsylvania State University. At UC San Diego, Dr. Drews focuses on the long-term, continued development and improvement of core undergraduate chemical engineering courses.

Published 2019

View Articles for Related Capabilities