Curriculum Module
Created with R2023b. Compatible with R2023b and later releases.
This curriculum module contains interactive MATLAB® live scripts that teach fundamental concepts and basic terminology related to programming computers. This includes discussion of inputs and outputs, numbers, strings, arrays, branches and loops. This content is broken into six instructional live scripts and one project where live script instructions are paired with a plain code practice script. Solutions are available to instuctors upon request.
You can use these live scripts as demonstrations in lectures, class activities, or interactive assignments outside class. Fundamentals of Programming includes an introduction to programming which includes discussion of errors, documentation, and other commonly encountered challenges for beginners. Data introduces double and string data types. Arrays introduces 1, 2, and 3-D arrays, as well as a brief overview of matrix operations. Applications include both text and image data. Branches introduces the concept of conditional branching in the form of if/else branches and switch statements. Loops introduces the concept of conditional looping in the form of for loops and while loops. Chaos Game Project provides a scaffolded approach to implementing the chaos game by combining skills from each of the other scripts. The final script, Algorithms, introduces algorithms, pseudocode, and testing. Additional files include the navigation file Main Menu and the Collected Pro Tips.
The instructions inside the live scripts will guide you through the exercises and activities. Get started with each live script by running it one section at a time. To stop running the script or a section midway (for example, when an animation is in progress), use the Stop button in the RUN section of the Live Editor tab in the MATLAB Toolstrip.
Solutions are available upon instructor request. Contact the MathWorks teaching resources team if you would like to request solutions, provide feedback, or if you have a question.
This module assumes familiarity with basic mathematics at a high school level. One exercise in Data.mlx requires the use of the quadratic formula, for instance. Understanding the chaos game requires locating points on a Cartesian coordinate system and understanding of either vectors or midpoints. Trigonometric functions are used as example functions. With respect to programming knowledge, this module is intended for absolute beginners who have used simple calculators in the past.
Use the link to download the module. You will be prompted to log in or create a MathWorks account. The project will be loaded, and you will see an app with several navigation options to get you started.
Download or clone this repository. Open MATLAB, navigate to the folder containing these scripts and double-click on FundamentalsofProgramming.prj. It will add the appropriate files to your MATLAB path and open an app that asks you where you would like to start.
Ensure you have all the required products (listed below) installed. If you need to include a product, add it using the Add-On Explorer. To install an add-on, go to the Home tab and select Add-Ons > Get Add-Ons.
MATLAB® is used throughout. The imsplit
command in Arrays.mlx
is from the Image Processing Toolbox™.
Branches |
In this script, students will... |
---|---|
- recognize and apply if/then branching logic to solve problems. - recognize and apply switch branching logic to solve problems. |
Algorithms |
In this script, students will... |
---|---|
- explain the concept of an algorithm. - implement an algorithm presented in pseudocode. - explain the importance of testing both code and algorithms. |
Main Menu - Just the link sections of this script for navigation
Collected Pro Tips - Notes on how to implement particular concepts in MATLAB
The license for this module is available in the LICENSE.md.
Courseware Module | Sample Content | Available on: |
---|---|---|
Treasure Hunt Game: Learn to Code Build and customize an interactive searching game |
GitHub | |
Programming: Structuring Code Learn how to organize your code into functions, debug, comment, and share |
GitHub | |
Programming: Organizing Data Learn more about strings, numeric data types, memory, and ways of storing data |
GitHub | |
Programming: A Starter Project Using MATLAB and Python Use MATLAB, Python, and the OpenWeather API together to implement a weather prediction dashboard |
GitHub |
Or feel free to explore our other modular courseware content.
Looking for more? Find an issue? Have a suggestion? Please contact the MathWorks teaching resources team. If you want to contribute directly to this project, you can find information about how to do so in the CONTRIBUTING.md page on GitHub.
© Copyright 2023 The MathWorks™, Inc