MATLAB Numerical Calculations - Cesar Perez Lopez.pdf

(9630 KB) Pobierz
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
About the Author .................................................................................................................xi
Introduction ........................................................................................................................
xv
Chapter 1: Introduction to MATLAB ...................................................................................1
Chapter 2: Integers, Divisibility and Number Systems ....................................................11
Chapter 3: Real and Complex Numbers ...........................................................................43
Chapter 4: Numerical Variables, Vectors and Matrices ...................................................95
Chapter 5: Vectors and Matrices ...................................................................................139
Chapter 6: Functions .....................................................................................................179
Chapter 7: Programming and Numerical Analysis ........................................................211
Chapter 8: Numerical Algorithms: Equations, Derivatives, Integrals and
Differential Equations ....................................................................................................279
iii
Introduction
MATLAB is the tool of the modern day mathematician or engineer.
The
incredible deep functionality of MATLAB
makes what would have taken hours 40 years ago, often less than a minute with MATLAB built in functions. MATLAB
enables you to explore multiple approaches and reach a solution faster often more accurately than with other tools
or traditional programming languages, such as C/C++ or Java. More importantly, it has changed the way we learn
and made getting solutions immensely simpler. So, you can now focus on the application, instead of the math. And
with that easily available power, you can explore and
find
more and more functions, test hypotheses and become a
significantly more powerful worker.
This
book is designed for use, in part, as a tool to enable you to use MATLAB as a scientific/business calculator
so that you can get numerical solutions to problems involving a wide array of mathematics using MATLAB. But it
is broader in scope than that.
The
book can be used as an independent resource for MATLAB. A background in the
necessary mathematics is assumed, so this book shows you how to interpret your problems to get MATLAB to do what
you want it to do. Just look up the function you want in the book and you are ready to use it in MATLAB or use the
book to learn about the enormous range of options that MATLAB offers.
The
book is topical, picking examples to show
not only general methods in using MATLAB, but specifics to use MATLAB for advanced mathematical computations
while giving a glimpse at their application.
MATLAB Numerical Calculations
focuses on MATLAB capabilities to give you numerical solutions to problems
you are likely to encounter in your professional or scholastic life. It introduces you to the MATLAB language with
practical hands-on instructions and results, allowing you to quickly achieve your goals. Starting with a look at basic
MATLAB functionality with integers, rational numbers and real and complex numbers, and MATLAB’s relationship
with Maple, you will learn how to solve equations in MATLAB, and how to simplify the results. You will see how
MATLAB incorporates vector, matrix and character variables, and functions thereof. MATLAB is a powerful tool used
to defined, manipulate and simplify complex algebraic expressions. With MATLAB you can also work with ease in
matrix algebra, making use of commands which allow you to
find
eigenvalues, eigenvectors, determinants, norms and
various matrix decompositions, among many other features. Lastly, you will see how you can write scripts and use
MATLAB to explore numerical analysis,
finding
approximations of integrals, derivatives and numerical solutions of
differential equations.
xv
CHAPTER 1
Introduction to MATLAB
1.1 Numerical Calculations with MATLAB
You can use MATLAB as a powerful numerical calculator. While most calculators handle numbers only to a preset
degree of accuracy, MATLAB works to whichever precision is necessary for any given calculation. In addition, unlike
calculators, we can perform operations not only with individual numbers, but also with objects such as matrices.
Most classical numerical analysis topics are treated by MATLAB. It supports matrix algebra, statistics,
interpolation, fit by least squares, numerical integration, minimization of functions, linear programming, numerical
solutions of algebraic equations and differential equations and a long list of further techniques.
Here are some examples of numerical calculations with MATLAB (once the commands have been entered to the
right of the input prompt “>>” simply hit
Enter
to obtain the result):
1.
We can calculate 4 + 3 and get 7 as a result. To do this, just type 4 + 3 and then
Enter:
>> 4 + 3
ans =
7
2.
We can also find the value of 3 raised to the power 100, without previously fixing the
precision. For this it is enough to simply type 3 ^ 100:
>> 3 ^ 100
ans =
5. 1538e + 047
3.
We can also use the command
format long e
to obtain results in scientific notation with
16 more exponential digits of precision:
>> format long e;
>> 3 ^ 100
ans =
5.153775207320115e+047
1
Zgłoś jeśli naruszono regulamin