This concise article of thirty pages takes you on a short tour on how to write small programs using MATLAB. The presentation covers both script files and function files. Several programming constructs are illustrated with simple examples. Loops are discussed using the For and While loops, while decisions are implemented using the If Else and Switch Case constructs. At the end of the presentation, a simple example is presented to show symbolic computing with the If Else statement. The presentation is made in the form of solved examples showing the exact MATLAB commands used and the output. At the end of the article, there are about eleven unsolved exercises for students to practice. The solutions to all the exercises are also provided. This article is taken form the bestselling book “MATLAB for Beginners: A Gentle Approach.” The material presented is not intended to be comprehensive or exhaustive but merely an introduction to programming using MATLAB.
Read alsoMATLAB for Beginners: A Gentle Approach - Revised Edition
This book is written for beginners and students who wish to learn MATLAB. One of the objectives of writing this book is to introduce MATLAB to students in high schools. The material presented is very easy and simple to understand - written in a gentle manner. The topics covered in the book include arithmetic operations, variables, mathematical…