Chapter 5 Top-down Design and Branching Statements
This chapter introduces a systematic method for designing programs called top-down design, and it also introduces a new class of programming statements, called branching statements. The two are relat
Introduction to Programming With Matlab
J. Michael Fitzpatrick and John D. Crocetti
Introduction to Programming with Matlab
J. Michael Fitzpatrick and John D. Crocetti Department of Electrical Engineering and Computer Science School of Engineering
Chapter 4 Linear algebra in Matlab
Mathematical problems involving equations of the form Ax=b, where A is a matrix and x and b are both column vectors are problems in linear algebra, sometimes also called matrix algebra. Engineering and scientific an
The basic unit with which we work in Matlab is the matrix (plural is matrices). We add them, subtract them, multiply them, and perform many other operations on them. In this chapter, we introduce the basic idea of the matrix. We show how Matlab allow
1
To gain the most from this book, you should, as you read it, be continually writing and
testing examples in Matlab. To run the examples in this book you should have the following version of Matlab installed on your computer: Version 7, Release 14
Preface
This book is meant for students of engineering or science who need both a useful programming language for solving problems in their disciplines and an introduction to ideas from the discipline of computer science. It is a provided free of cha
Chapter 12 Symbolic Mathematics
When mathematicians work, they use symbols, such as x and y, to represent numbers
and the functional notation f(x) to represent a function of x. We have used the same symbols in Matlab, and yet the meanings are subtly
Chapter 11 Graphical User Interfaces
By default, Matlab runs through a command line interface. That is, individual commands, functions or scripts are executed by typing instructions into the command window and pressing enter. For many years, this was
Chapter 10 Searching and Sorting
In this chapter we will look at two closely related problems: searching and sorting. Both problems appear in applications involving databases, and without efficient solutions to these problems databases would be virtu
This chapter introduces a fundamental new method of programming called recursion. Recursion is a powerful idea that makes it possible to solve some problems easily that would otherwise be quite difficult. Recursion cannot be used in all programming l
Chapter 8 Data Types
Every modern programming language provides means for storing numbers in variables, operating on them, and printing them. Matlab is no exception, and we have seen countless examples of numbers being stored, operated on, and print
Chapter 7 User Defined Functions
To this point, the programs you have written have relied almost exclusively on sequential control. And while you have used control constructs such as loops and conditional statements to alter that sequential processi
Chapter 6 Loops
In the last chapter, we introduced the idea of a control construct, a method by which Matlab will depart from its customary sequential processing. Initially, we accomplished this task through the use selection. That is, we used either
Chapter 1 Introduction
Computers are capable of remarkable feats of data manipulation and numerical
calculation, but they do only what they are told to do. They manipulate and calculate at incredible speed and have enormous memories, but unless they