Colegio Sagrado Corazón Jesuitas León Teaches Secondary School Math Concepts Using MATLAB Live Scripts

“When our students go on to university and their careers, they won’t be using 20th-century technology. By integrating theory with current technology, interactive notebooks based on MATLAB live scripts have the power to dramatically improve the way we teach and prepare students for today’s challenges.”


Increase student engagement in secondary-school mathematics classes


Use MATLAB live scripts to create interactive notebooks and introduce basic programming concepts


  • Diverse educational needs met
  • Traditional and digital teaching methods integrated
  • Programming basics introduced early
Live script, built with MATLAB Live Editor, used to teach mathematics concepts.

Live script, built with MATLAB Live Editor, used to teach mathematics concepts.

Located in León, Spain, Colegio Sagrado Corazón Jesuitas León is a Jesuit school with an enrollment of about 1,100 students. Like many of the approximately 60 Jesuit schools located throughout the country, Colegio Jesuitas León features a comprehensive secondary school curriculum, with classes in language and literature, mathematics, geography and history, religion, physical education, and the arts and sciences. And, like secondary schools worldwide, Colegio Jesuitas León is looking for new ways to engage students who tend to be more comfortable with technology than traditional textbooks.

In a mathematics class for 14- and 15-year-olds, Pablo López, mathematics teacher, recently introduced a new instructional approach in which textbooks have largely been replaced with MATLAB® live scripts. Students use the live scripts as interactive notebooks to learn how to analyze and solve different types of equations and systems of equations. “Textbook-based lessons are very static. Students are expected to read the text and do the exercises, but it’s difficult for them to get a deep understanding of the mathematical concepts,” says López. “Live scripts in MATLAB, in contrast, are dynamic. Students can modify parameter values interactively and see how their changes affect the behavior of a function or equation. The interaction engages them and makes it easier to understand the underlying theory.”


Aside from a lack of student engagement, López found that a principal drawback of traditional textbook-oriented lessons was that they do not work well in classes with students of varied abilities—which is virtually every class. Advanced students can grasp the material easily, but soon become bored because there is no easy way to explore concepts in greater depth. Other students have more difficulty learning new concepts from static text and graphs and would benefit from a more dynamic environment.

López wanted to introduce basic programming into the class, in part to make the process of analyzing and solving equations more interesting and to prepare students for a world in which scientific and technical problems are solved computationally, not manually. Recognizing the difficulty beginners often have with compilers, syntax errors, and similar coding issues, he wanted to provide students with an environment in which code, output, equations, and formatted text can be presented together in single script. This would help reduce errors and distractions.


Working in MATLAB Live Editor, López developed a set of live scripts based on material covered in the class textbook on topics that include equivalent equations, first- and second-degree equations, systems of equations, the substitution method, and the elimination method.

When he begins teaching a topic for the first time, López displays the live script on a digital whiteboard in the classroom as he lectures. The students complete some basic exercises on the topic by hand, before López returns to the live script and explains how those same exercises are solved in code. Using built-in sliders, he shows how various parameter values affect the shape of an equation’s graph.

López posts the live scripts to a MATLAB folder, where students access them using MATLAB Mobile™ on their iPhone or iPad devices.

On Friday of each week, López has the students work on small projects designed to engage them more deeply with the week’s material. For one such project, students use MATLAB Online™ and App Designer to build an app for solving equations. On another, students build simple LEGO® MINDSTORMS® applications using MATLAB and Simulink®.

López has shared Spanish, English, and French versions of live scripts he developed for the class on MATLAB File Exchange. His colleagues at Colegio Jesuitas León are now exploring the use of live scripts to teach other subjects, including physics, with the idea of eventually replacing all physical textbooks across areas of study.


  • Diverse educational needs met. “With MATLAB, I can adapt my teaching to the very different abilities of my students,” says López. “Faster students have the opportunity of going deeper into the material working without me. That gives me more time to focus on the students who need more help and create live scripts that help them grasp new concepts visually.”
  • Traditional and digital teaching methods integrated. “By merging traditional notes with MATLAB programming, live scripts make it possible to create instructional material that is both interactive and functional,” says López. “The result is not just a digitization of old material, but a meaningful improvement upon it.”
  • Programming basics introduced early. “By integrating MATLAB into my class, I was able to give secondary school students an early introduction to basic programming concepts as they learned mathematics,” says López. “Students will benefit from that experience when they get to university and in the years to come.”