Learning Matlab 6 Release 12 Matlab Student Version 2nd Printing Edition The Mathworks - The ebook in PDF and DOCX formats is ready for download now
Learning Matlab 6 Release 12 Matlab Student Version 2nd Printing Edition The Mathworks - The ebook in PDF and DOCX formats is ready for download now
https://ebookultra.com/download/computational-colour-science-using-
matlab-2nd-edition-stephen-westland/
https://ebookultra.com/download/matlab-numerical-calculations-lopez/
https://ebookultra.com/download/classical-feedback-control-with-
matlab-and-simulink-2nd-edition-lurie/
https://ebookultra.com/download/essential-matlab-for-scientists-and-
engineers-2nd-edition-brian-hahn/
Computational Statistics Handbook with MATLAB 2nd Edition
Wendy L. Martinez
https://ebookultra.com/download/computational-statistics-handbook-
with-matlab-2nd-edition-wendy-l-martinez/
https://ebookultra.com/download/engineering-computation-with-
matlab-2nd-ed-edition-david-m-smith/
https://ebookultra.com/download/matlab-demystified-1st-edition-david-
mcmahon/
https://ebookultra.com/download/numerical-computing-with-matlab-
revised-reprint-2nd-edition-cleve-b-moler/
https://ebookultra.com/download/fundamentals-of-digital-signal-
processing-using-matlab-2nd-edition-robert-j-schilling/
Learning Matlab 6 Release 12 Matlab Student Version
2nd Printing Edition The Mathworks Digital Instant
Download
Author(s): The MathWorks
ISBN(s): 9780967219530, 0967219531
Edition: 2nd Printing
File Details: PDF, 2.16 MB
Year: 2001
Language: english
MATLAB
®
STUDENT VERSION
Computation
Visualization
Programming
Learning MATLAB
Version 6 (Release 12)
How to Contact The MathWorks:
www.mathworks.com Web
ftp.mathworks.com Anonymous FTP server
comp.soft-sys.matlab Newsgroup
ISBN 0-9672195-3-1
Learning MATLAB
COPYRIGHT 1999 - 2001 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used
or copied only under the terms of the license agreement. No part of this manual may be photocopied or repro-
duced in any form without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by
or for the federal government of the United States. By accepting delivery of the Program, the government
hereby agrees that this software qualifies as "commercial" computer software within the meaning of FAR
Part 12.212, DFARS Part 227.7202-1, DFARS Part 227.7202-3, DFARS Part 252.227-7013, and DFARS Part
252.227-7014. The terms and conditions of The MathWorks, Inc. Software License Agreement shall pertain
to the government’s use and disclosure of the Program and Documentation, and shall supersede any
conflicting contractual terms or conditions. If this license fails to meet the government’s minimum needs or
is inconsistent in any respect with federal procurement law, the government agrees to return the Program
and Documentation, unused, to MathWorks.
MATLAB, Simulink, Stateflow, Handle Graphics, and Real-Time Workshop are registered trademarks, and
Target Language Compiler is a trademark of The MathWorks, Inc.
Other product or brand names are trademarks or registered trademarks of their respective holders.
Printing History: August 1999 First printing New manual
January 2001 Second printing Revised for MATLAB 6.0 (Release 12)
Contents
Introduction
1
About the Student Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Student Use Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Differences Between the Student Version
and the Professional Version . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
iii
Installation
2
Installing on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Installing MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Installing Additional Toolboxes . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Accessing the Online Documentation (Help) . . . . . . . . . . . . . . . 2-6
Development Environment
3
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
iv Contents
Getting Started
4
Matrices and Magic Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Entering Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
sum, transpose, and diag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Subscripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
The Colon Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
The magic Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
Examples of Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
v
Graphics
5
Basic Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Creating a Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Multiple Data Sets in One Graph . . . . . . . . . . . . . . . . . . . . . . . . 5-3
Specifying Line Styles and Colors . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Plotting Lines and Markers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
Imaginary and Complex Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
Adding Plots to an Existing Graph . . . . . . . . . . . . . . . . . . . . . . . 5-7
Figure Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
Multiple Plots in One Figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
Controlling the Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
Axis Labels and Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12
Saving a Figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13
Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24
Animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-37
Erase Mode Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-37
Creating Movies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-38
vi Contents
Programming with MATLAB
6
Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
if . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
switch and case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4
while . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
continue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
vii
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
Symbolic Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
Creating Symbolic Variables and Expressions . . . . . . . . . . . . . . 7-6
Symbolic and Numeric Conversions . . . . . . . . . . . . . . . . . . . . . . 7-7
Creating Symbolic Math Functions . . . . . . . . . . . . . . . . . . . . . 7-14
Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16
Differentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16
Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20
Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22
Symbolic Summation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-27
Taylor Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28
Extended Calculus Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-29
viii Contents
MATLAB Quick Reference
A
ix
x Contents
1
Introduction
About the Student Version . . . . . . . . . . . . . 1-2
1-2
About the Student Version
You may not use this Student License at a company or government lab. Also,
you may not use it for research or for commercial or industrial purposes. In
these cases, you can acquire the appropriate professional or academic version
of the software by contacting The MathWorks.
Note MATLAB does not have a matrix size limitation in this Student
Version.
MATLAB Differences. There are a few small differences between the Student
Version and the professional version of MATLAB:
This footer is not an option that can be turned off; it will always appear in
your printouts.
1-3
1 Introduction
Simulink
This Student Version contains the complete Simulink product, which is used
with MATLAB to model, simulate, and analyze dynamical systems.
Simulink Differences.
This footer is not an option that can be turned off; it will always appear in
your printouts.
Note Using Simulink, which is accessible from the Help browser, contains all
of the Simulink related information in the Learning Simulink book plus
additional, advanced information.
1-4
Obtaining Additional MathWorks Products
• Communications
• Control System
• Fuzzy Logic
• Image Processing
• Neural Network
• Optimization
• Signal Processing
• Statistics
• Stateflow® (A demo version of Stateflow is included
with your Student Version.)
For an up-to-date list of which toolboxes are available, visit the MathWorks
Store.
Note The toolboxes that are available for the Student Version of MATLAB &
Simulink have the same functionality as the full, professional versions.
However, these student versions will only work with the Student Version.
Likewise, the professional versions of the toolboxes will not work with the
Student Version.
1-5
1 Introduction
I’m new to MATLAB and Start by reading Chapters 1 through 6 of Learning MATLAB.
want to learn it quickly. The most important things to learn are how to enter matrices,
how to use the : (colon) operator, and how to invoke functions.
You will also get a brief overview of graphics and programming
in MATLAB. After you master the basics, you can access the rest
of the documentation through the online help facility (Help).
I want to look at some There are numerous demonstrations included with MATLAB.
samples of what you can do You can see the demos by selecting Demos from the Help menu.
with MATLAB. (Linux users type demo at the MATLAB prompt.) There are
demos in mathematics, graphics, visualization, and much more.
You also will find a large selection of demos at
www.mathworks.com/demos.
1-6
Finding Reference Information
I want to know how to use a Use the online help facility (Help). To access Help, use the
specific function. command helpbrowser or use the Help menu. The MATLAB
Function Reference is also available from Help in PDF format
(under Printable Documentation) if you want to print out any
of the function descriptions in high-quality form. Note: Your
MathWorks documentation CD must be in your CD-ROM drive
to access Help.
I want to learn about a Use Help to locate the appropriate sections in Using MATLAB.
specific topic like sparse
matrices, ordinary
differential equations, or cell
arrays.
I want to know what Use Help to see the Function Reference by Category, or see
functions are available in a Appendix A, “MATLAB Quick Reference,” in this book for a list
general area. of MATLAB functions. Help provides access to the reference
pages for the hundreds of functions included with MATLAB.
I want to learn about the See Chapter 7, “Symbolic Math Toolbox,” and Appendix B,
Symbolic Math Toolbox. “Symbolic Math Toolbox Quick Reference,” in this book. For
complete descriptions of the Symbolic Math Toolbox functions,
use Help and select Reference from Symbolic Math Toolbox.
1-7
1 Introduction
Documentation Library
Your Student Version of MATLAB & Simulink contains much more
documentation than the two printed books, Learning MATLAB and Learning
Simulink. On your CD is a personal reference library of every book and
reference page distributed by The MathWorks. Access this documentation
library from Help.
Note Even though you have the documentation set for the MathWorks family
of products, not every product is available for the Student Version of MATLAB
& Simulink. For an up-to-date list of available products, visit the MathWorks
Store. At the store you can also purchase printed manuals for the MATLAB
family of products.
1-8
Troubleshooting and Other Resources
Note When you start MATLAB for the first time, the Help Navigator
displays entries for additional products. To learn how to change the displayed
product list, see the “Product Filter” on page 3-10.
1-9
1 Introduction
MathWorks Store
The MathWorks Store (www.mathworks.com/store) gives you an easy way to
purchase add-on products and documentation.
Usenet Newsgroup
If you have access to Usenet newsgroups, you can join the active community of
participants in the MATLAB specific group, comp.soft-sys.matlab. This
forum is a gathering of professionals and students who use MATLAB and have
questions or comments about it and its associated products. This is a great
resource for posing questions and answering those of others. MathWorks staff
also participates actively in this newsgroup.
1-10
Other documents randomly have
different content
of the covered way has thus been reached, batteries of heavy
artillery will be there established, for the purpose of breaching the
walls of the ravelin and bastion; while at the same time miners will
first seek to destroy the defenders’ countermines (which would
otherwise be likely to send these batteries into the air), and then will
excavate a tunnel to the ditch at the foot of the counterscarp. If the
breach becomes practicable, a storming party will emerge from this
tunnel or gallery, and seek to carry the opposite work by hard
fighting. If inner works still subsist, which would tear assailants to
pieces, the double sap may be continued across the ditch, if a dry
ditch, right up the breach, that counter-batteries may be formed. If
the ditch be wet, means must be adopted for a causeway or a
bridge. By these means, however obstinate may be the defense, if
the besieging force be sufficiently strong, and aid do not arrive from
without, the ultimate success of the attack becomes certain. Vauban
raised attack to a superiority above defense, first by the introduction
of ricochet fire, which sweeps a whole line; and secondly by
originating parallels. Before his time, the whole attack was
conducted by zigzag approaches, in which the troops actually in
front could be but few, and were therefore unable to withstand
strong sorties of the garrison, who, in consequence, frequently broke
out and destroyed the works of the besiegers, rendering a siege an
operation of the most uncertain character.
Siege and Sea-coast Ammunition. See Ordnance, Ammunition
for.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com