MATLAB for Engineering Applications, 5e ISE 5th/ISE Edition William J. Palm Iii - eBook PDF download
MATLAB for Engineering Applications, 5e ISE 5th/ISE Edition William J. Palm Iii - eBook PDF download
https://ebookluna.com/download/matlab-for-engineering-
applications-5e-ise-ebook-pdf/
https://ebookluna.com/product/system-dynamics-3rd-edition-by-william-j-
palm-iii-ebook-pdf/
https://ebookluna.com/download/system-dynamics-4th-edition-ebook-pdf/
https://ebookluna.com/product/ebook-pdf-matlab-for-engineering-
applications-4th-edition/
ISE Principles of Statistics for Engineers and Scientists (ISE HED IRWIN
INDUSTRIAL ENGINEERING) 2nd Edition William Navidi Prof. - eBook PDF
https://ebookluna.com/download/ise-principles-of-statistics-for-engineers-
and-scientists-ise-hed-irwin-industrial-engineering-ebook-pdf/
Engineering Mathematics for Semesters III and IV - eBook PDF
https://ebookluna.com/download/engineering-mathematics-for-semesters-iii-
and-iv-ebook-pdf/
https://ebookluna.com/product/ebook-pdf-system-dynamics-4th-edition-by-
william-palm/
https://ebookluna.com/product/ebook-pdf-matlab-an-introduction-with-
applications-5th-edition/
MATLAB Programming for Engineers 6th Edition Stephen J. Chapman - eBook PDF
https://ebookluna.com/download/matlab-programming-for-engineers-ebook-pdf/
https://ebookluna.com/download/oil-palm-biomass-for-composite-panels-
fundamentals-processing-and-applications-ebook-pdf/
MATLAB® for
page i
Engineering
Applications
Published by McGraw Hill LLC, 1325 Avenue of the Americas, New York,
NY 10019. Copyright ©2023 by McGraw Hill LLC. All rights reserved.
Printed in the United States of America. No part of this publication may be
reproduced or distributed in any form or by any means, or stored in a
database or retrieval system, without the prior written consent of McGraw
Hill LLC, including, but not limited to, in any network or other electronic
storage or transmission, or broadcast for distance learning.
1 2 3 4 5 6 7 8 9 LCR 27 26 25 24 23 22
ISBN 978-1-265-13919-3
MHID 1-265-13919-9
All credits appearing on page or at the end of the book are considered to be
an extension of the copyright page.
The Internet addresses listed in the text were accurate at the time of
publication. The inclusion of a website does not indicate an endorsement by
the authors or McGraw Hill LLC, and McGraw Hill LLC does not
guarantee the accuracy of the information presented at these sites.
mheducation.com/highered
To my sisters, Linda and Chris, and to my parents, page iii
CHAPTER 1
An Overview of MATLAB® 3
1.1 MATLAB Interactive Sessions 4
1.2 The Toolstrip 17
1.3 Built-In Functions, Arrays, and Plots 18
1.4 Working with Files 24
1.5 The MATLAB Help System 32
1.6 Problem-Solving Methodologies 35
1.7 Summary 42
Problems 43
CHAPTER 2
Numeric, Cell, and Structure Arrays 51
2.1 One- and Two-Dimensional Numeric Arrays 52
2.2 Multidimensional Numeric Arrays 61
2.3 Element-by-Element Operations 62
2.4 Matrix Operations 72
2.5 Polynomial Operations Using Arrays 91
2.6 Cell Arrays 96
2.7 Structure Arrays 98
2.8 Summary 102
Problems 103
CHAPTER 3
Functions 121
3.1 Elementary Mathematical Functions 121
3.2 User-Defined Functions 128
3.3 Additional Function Types 143
3.4 File Functions 158
3.5 Summary 160
Problems 161
CHAPTER 4
Programming with MATLAB 169
4.1 Program Design and Development 170
4.2 Relational Operators and Logical Variables 177
4.3 Logical Operators and Functions 179
4.4 Conditional Statements 186
4.5 for Loops 194
4.6 while Loops 206
4.7 The switch Structure 212
4.8 Debugging MATLAB Programs 214
4.9 Additional Examples and Applications 217
4.10 Summary 231
Problems 232
CHAPTER 5
Advanced Plotting 251
5.1 xy Plotting Functions 251
5.2 Additional Commands and Plot Types 261
5.3 Interactive Plotting in MATLAB 278
5.4 Three-Dimensional Plots 280
5.5 Summary 286
Problems 287
CHAPTER 6
Model Building and Regression 299
6.1 Function Discovery 299
6.2 Regression 310
6.3 The Basic Fitting Interface 326
6.4 Summary 329
Problems 330
7
page vi
CHAPTER
Statistics, Probability, and Interpolation 341
7.1 Statistics and Histograms 342
7.2 The Normal Distribution 346
7.3 Random Number Generation 352
7.4 Interpolation 361
7.5 Summary 370
Problems 370
CHAPTER 8
Linear Algebraic Equations 379
8.1 Matrix Methods for Linear Equations 380
8.2 The Left-Division Method 383
8.3 Underdetermined Systems 389
8.4 Overdetermined Systems 398
8.5 A General Solution Program 402
8.6 Summary 404
Problems 405
CHAPTER 9
Numerical Methods for Calculus and Differential Equations
419
9.1 Numerical Integration 420
9.2 Numerical Differentiation 428
9.3 First-Order Differential Equations 431
9.4 Higher-Order Differential Equations 439
9.5 Special Methods for Linear Equations 445
9.6 Summary 458
Problems 459
CHAPTER 10
Simulink 471
10.1 Simulation Diagrams 472
10.2 Introduction to Simulink 473
10.3 Linear State-Variable Models 478
10.4 Piecewise-Linear Models 481
10.5 Transfer-Function Models 487
10.6 Nonlinear State-Variable Models 489
10.7 Subsystems 491
10.8 Dead Time in Models 496
10.9 Simulation of a Nonlinear Vehicle Suspension Model 499
10.10 Control Systems and Hardware-in-the-Loop Testing 503
10.11 Summary 513
Problems 514
CHAPTER 11
Symbolic Processing with MATLAB 525
11.1 Symbolic Expressions and Algebra 527
11.2 Algebraic and Transcendental Equations 536
11.3 Calculus 543
11.4 Differential Equations 555
11.5 Laplace Transforms 562
11.6 Symbolic Linear Algebra 570
11.7 Summary 575
Problems 576
CHAPTER 12
Projects with Matlab 589
12.1 MATLAB Mobile 590
12.2 Programming Game Projects in MATLAB 595
12.3 The MATLAB App Designer 600
APPENDIX A
Guide to Commands and Functions in This Text 603
APPENDIX B
Animation and Sound in MATLAB 615
APPENDIX C
References 626
APPENDIX D
Formatted Output in MATLAB 627
Answers to Selected Problems 631
Index 634
Numbered Examples page vii
F
ormerly used mainly by specialists in signal processing and numerical
analysis, MATLAB® has achieved widespread and enthusiastic
acceptance throughout the engineering community. Many engineering
schools require a course based entirely or in part on MATLAB early in the
curriculum. MATLAB is programmable and has the same logical,
relational, conditional, and loop structures as other programming languages.
Thus it can be used to teach programming principles. In most engineering
schools, MATLAB is the principal computational tool used throughout the
curriculum. In some technical specialties, such as signal processing and
control systems, it is the standard software package for analysis and design.
The popularity of MATLAB is partly due to its long history, and thus it is
well developed and well tested. People trust its answers. Its popularity is
also due to its user interface, which provides an easy-to-use interactive
environment that includes extensive numerical computation and
visualization capabilities. Its compactness is a big advantage. For example,
you can solve a set of many linear algebraic equations with just three lines
of code, a feat that is impossible with traditional programming languages.
MATLAB is also extensible; currently more than 30 “toolboxes” in various
application areas can be used with MATLAB to add new commands and
capabilities.
MATLAB is available for a number of operating systems. It is
compatible across all these platforms, which enables users to share their
programs, insights, and ideas. This text is based on release R2021a of the
software. This includes MATLAB version 9.10. Some of the material in
Chapter 9 is based on the Control System toolbox, Version 10.10. Chapter
10 is based on Version 10.3 of Simulink®, and Chapter 11 is based on
Version 8.7 of the Symbolic Math toolbox.
TEXT ORGANIZATION
In addition to updating material from the previous edition to include new
features, new functions, and changes in syntax and function names, the text
incorporates the many suggestions made by reviewers and other users.
More examples and homework problems have been added.
The text consists of 12 chapters. The first five chapters constitute a basic
course in MATLAB. The remaining seven chapters are independent of each
other and cover more advanced applications of MATLAB, the Control
Systems toolbox, Simulink, and the Symbolic Math toolbox.
Chapter 1 gives an overview of MATLAB features, including its
windows and menu structures. It also introduces the problem-solving
methodology.
Chapter 2 introduces the concept of an array, which is the fundamental
data element in MATLAB, and describes how to use numeric arrays, cell
arrays, and structure arrays for basic mathematical operations.
Chapter 3 discusses the use of functions and files. MATLAB has an
extensive number of built-in math functions, and users can define their own
functions and save them as a file for reuse.
Chapter 4 introduces programming with MATLAB and covers relational
and logical operators, conditional statements, for and while loops, and the
switch structure.
Chapter 5 deals with two- and three-dimensional plotting. It first
establishes standards for professional-looking, useful plots. In the author’s
experience, beginning students are not aware of these standards, so they are
emphasized. The chapter then covers MATLAB commands for producing
different types of plots and for controlling their appearance. The Live
Editor, which is a major addition to MATLAB, is covered in Section 5.1.
Chapter 6 covers function discovery, which uses data plots to discover a
mathematical description of the data and is a useful tool for model building.
It is a common application of plotting, and a separate section is devoted to
this topic. The chapter also treats polynomial and multiple linear regression
as part of its modeling coverage.
Chapter 7 reviews basic statistics and probability and shows how to use
MATLAB to generate histograms, perform calculations with the normal
distribution, and create random number simulations. The chapter concludes
with linear and cubic spline interpolation.
Chapter 8 covers the solution of linear algebraic equations, which arise in
applications in all fields of engineering. This coverage establishes the
terminology and some important concepts required to use the computer
methods properly. The chapter then shows how to use MATLAB to solve
underdetermined and overdetermined systems of linear equations.
The text has the following special features, which have been designed to
enhance its usefulness as a reference.
■ Throughout each of the chapters, numerous tables summarize the
commands and functions as they are introduced.
■ Appendix A is a complete summary of all the commands and functions
described in the text, grouped by category, along with the number of the
page on which they are described.
■ At the end of the chapter is a list of the key terms introduced in the
chapter, with a reference to where they are introduced.
■ The index has four sections: a listing of MATLAB symbols, an
alphabetical list of MATLAB commands and functions, a list of
Simulink block names, and an alphabetical list of topics.
PEDAGOGICAL AIDS
The following pedagogical aids have been included:
■ Each chapter begins with an overview.
■ Test Your Understanding exercises appear throughout the chapters near
the relevant text. These relatively straightforward exercises allow
readers to assess their grasp of the material as soon as it is covered. In
most cases the answer to the exercise is given with the exercise.
Students should work these exercises as they are encountered.
■ Each chapter ends with numerous problems, grouped according to the
relevant section.
■ Each chapter contains numerous practical examples. The major
examples are numbered.
■ Each chapter has a summary section that reviews the chapter’s
objectives.
■ Answers to many end-of-chapter problems appear at the end of the text.
These problems are denoted by an asterisk next to their number (for
example, 15*).
Two features have been included to motivate the student toward
MATLAB and the engineering profession:
■ Most of the examples and the problems deal with engineering
applications. These are drawn from a variety of engineering fields and
show realistic applications of MATLAB. A guide to these examples
appears on page vii.
ONLINE RESOURCES
An Instructor’s Manual is available online for instructors who have adopted
this text. This manual contains the complete solutions to all of the Test Your
Understanding exercises and to all of the chapter problems. The text
website also has downloadable files containing the major programs and
PowerPoint slides keyed to the text.
MATLAB INFORMATION
For MATLAB and Simulink product information, please contact:
_________
®
MATLAB and Simulink are registered trademarks of The MathWorks, Inc.
page xiv
page xv
page 1
Engineering in the 21st Century. page 2
..
Remote Exploration
Source: NASA
I
t will be many years before humans can travel to other planets. In the
meantime, unmanned probes have been rapidly increasing our knowledge
of the universe. Their use will increase in the future as our technology
develops to make them more reliable and more versatile. Better sensors are
expected for imaging and other data collection. Improved robotic devices
will make these probes more autonomous, and more capable of interacting
with their environment, instead of just observing it.
NASA’s planetary rover Sojourner landed on Mars on July 4, 1997, and
excited people on Earth while they watched it successfully explore the
Martian surface to determine wheel-soil interactions, to analyze rocks and
soil, and to return images of the lander for damage assessment.
Then in early 2004, two improved rovers, Spirit and Opportunity, landed
on opposite sides of the planet. In one of the major discoveries of the 21st
century, they obtained strong evidence that water once existed on Mars in
significant amounts. Although planned to operate for only 90 Martian days,
Spirit operated for seven years. The rover likely lost power due to
excessively cold internal temperatures. Opportunity went inactive in 2018,
having already exceeded its planned operational life by many Earth years.
The rover Curiosity used the innovative “skycrane” to land on Mars in
2012 less than 2.4 km (1.5 mi) from its intended target after a 563,000,000
km (350,000,000 mi) journey. It was designed to investigate the Martian
climate and geology; to assess whether the Gale crater ever had an
environment suitable for microbial life, and to determine the habitability of
the site for future human exploration. Curiosity has a mass of 899 kg (1,982
lb) including 80 kg (180 lb) of instruments. The rover is 2.9 m (9.5 ft) long
by 2.7 m (8.9 ft) wide by 2.2 m (7.2 ft) in height. It discovered unexplained
variations in oxygen and methane, and found remnants of an ancient oasis.
Perseverance is a car-sized rover designed to explore the crater Jezero on
Mars. It was launched in July 2020 and successfully landed in February
2021. Perseverance has a design similar to Curiosity, but also carries the
experimental mini-helicopter Ingenuity that was able to fly in the weak
Martian atmosphere. The rover is intended to seek out evidence of former
microbial life, to collect rock and soil samples to store for retrieval by a
future mission, and to test oxygen production from the Martian atmosphere
in support of future crewed missions.
All engineering disciplines were involved with the rover projects. From
the design of the rocket propulsion of the launch vehicles and the calculation
of the interplanetary trajectories, to the design of the rovers’ systems,
MATLAB was used in many of these applications, and it is well suited to
assist designers of future probes and autonomous vehicles like the Mars
rovers. ■
page 3
CHAPTER
1
An Overview of MATLAB®*
OUTLINE
1.1 MATLAB Interactive Sessions
1.2 The Toolstrip
1.3 Built-In Functions, Arrays, and Plots
1.4 Working with Files
1.5 The MATLAB Help System
1.6 Problem-Solving Methodologies
1.7 Summary
Problems
This chapter covers many of the basic features of MATLAB. After you have
finished this chapter, you will be able to use MATLAB to solve many kinds
of problems. Section 1.1 provides an introduction to MATLAB as an
interactive calculator. Section 1.2 covers the main menus and the Toolstrip.
Section 1.3 introduces built-in functions, arrays, and plots. Section 1.4
discusses how to create, edit, and save MATLAB programs. Section 1.5
introduces the extensive MATLAB Help System and Section 1.6 introduces
the methodology of engineering problem solving, with emphasis on the use
of computers.
Conventions
In this text we use typewriter font to represent MATLAB commands, any
text that you type in the computer, and any MATLAB responses that appear
on the screen, for example, y = 6*x. Variables in normal mathematics text
appear in italics, for example, y = 6x. We use boldface type for three
purposes: to represent vectors and matrices in normal mathematics text (for
example, Ax = b), to represent an action on the keyboard (for example, press
Enter), and to represent the name of a screen menu or an item a menu when
it is the object of an action (for example, click on File). It is assumed that
you press the Enter key after you type a command. We do not show this
action with a separate symbol.
Figure 1.1–1 The default MATLAB Desktop for version R2021a. Source:
MATLAB
DESKTOP
Three other windows appear in the default Desktop. The Current page 6
Folder window is much like a file manager window; you can use it to
access files. Double-clicking on a file name with the extension .m will open
that file in the MATLAB Editor. The Editor is discussed in Section 1.4.
Figure 1.1–1 shows the files in the author’s folder Examples.
Underneath the Current Folder window is the Details window. It displays
the first comment (if any) in the file. Note that four file types are shown in
the Current Folder. These in order are a MATLAB script file, a JPEG figure
file, a MATLAB user-defined file, and a Simulink model file. These have the
extensions .m, .jpg, m, and .mdl, respectively. Each file type has its own
icon. We will cover m files in this chapter. The other file types will be
covered in later chapters. You can have other file types in the folder.
The Workspace window appears to the right. The Workspace window
displays the variables created in the Command window. Double-click on a
variable name to open the Variables Editor, which is discussed in Chapter 2.
VARIABLE
You can alter the appearance of the Desktop if you wish. For example, to
eliminate a window, just click on its Close-window button (×) in its upper
right-hand corner. To undock, or separate the window from the Desktop,
click on the button containing a curved arrow. An undocked window can be
moved around on the screen. You can manipulate other windows in the same
way. To restore the default configuration, click on Layout in the toolbar, and
select Default.
page 7
MATLAB indents the numerical result. MATLAB uses high precision for
its computations, but by default it usually displays its results using four
decimal places except when the result is an integer.
If you make a mistake, for now just press Enter and retype the line
correctly. Ignore for now any error messages you may see.
This is called an assignment statement. The variable, and only the variable,
is always on the left of the = symbol. This symbol is called the assignment or
replacement operator, and it cannot be used the same way as the equals sign
is used in mathematics. The previous entry means “assign the value of 8/10
to the variable r”.
If you now type r at the prompt and press Enter, you will see
thus verifying that the variable r has the value 0.8. You can use this variable
in further calculations. For example,
MATLAB ignores spaces when making its calculations, with one exception
that we will discuss in Chapter 2.
Order of Precedence
A scalar is a single number. A scalar variable is a variable that contains a
single number. MATLAB uses the symbols + − * / ^ for addition,
subtraction, multiplication, division, and exponentiation (power) of scalars.
These are listed in Table 1.1–1. For example, typing x = 8 + 3*5 returns the
answer x = 23. Typing 2^3 − 10 returns the answer ans = −2. The forward
slash (/) represents right division, which is the normal division operator
familiar to you. Typing 15/3 returns the result ans = 5.
Parentheses can be used to alter this order. Evaluation begins with the
innermost pair of parentheses and proceeds outward. Table 1.1–2
summarizes these rules. For example, note the effect of precedence on the
following session.
Table 1.1–2 Order of precedence
page 9
To avoid mistakes, feel free to insert parentheses wherever you are unsure of
the effect precedence will have on the calculation. Use of parentheses also
improves the readability of your MATLAB expressions. For example,
parentheses are not needed in the expression 8 + (3*5), but they make clear
our intention to multiply 3 by 5 before adding 8 to the result.
page 10
Parentheses must be balanced, which means that there must be an equal
number of left-facing and right-facing parentheses. However, just because
they are balanced does not mean the expression is correct. For example, to
evaluate the expression
the parentheses are balanced and MATLAB will not give an error message
but the answer will be incorrect. For example, if x = 8, the correct answer is
180, but the previous code gives 100.
EXAMPLE 1.1–1
Volume of a Circular Cylinder
The volume of a circular cylinder of height h and radius r is given by V =
πr2h. A particular cylindrical tank is 15 m tall and has a radius of 8 m. We
want to construct another cylindrical tank with a volume 20 percent greater
but having the same height. How large must its radius be?
■ Solution
First solve the cylinder equation for the radius r. This gives
The session is shown below. First we assign values to the variables r and h
representing the radius and height. Then we compute the volume of the
original cylinder and increase the volume by 20 percent. Finally we solve for
the required radius. For this problem we can use the MATLAB built-in
constant pi.
Thus the new cylinder must have a radius of 8.7636 m. Note that the page 12
original values of the variables r and V are replaced with the new
values. This is acceptable as long as we do not wish to use the original
values again. Note how precedence applies to the line V = pi*r^2*h;. It is
equivalent to V = pi*(r^2)*h;.
The expression r = (V/(pi*h))^(1/2) is an example of the use of nested
parentheses where the inner pair makes clear our intention to multiply pi by
h before dividing their product into V. The outer pair of parentheses is
required to indicate the target of the square root operation. You may always
use nested parentheses to indicate your intentions. Make sure they are used
in balanced pairs; otherwise you will get an “unbalanced parentheses
warning.”
Variable Names
The term workspace refers to the names and values of any variables in use in
the current work session. Variable names must begin with a letter; the rest of
the name can contain letters, digits, and underscore characters, but no spaces.
MATLAB is case-sensitive. Thus the following names represent five
different variables: speed, Speed, SPEED, Speed_1, and Speed_2.
There is a large, but finite limit to the number of characters in a name. This
can depend on the particular MATLAB version. Type namelengthmax to
determine this limit. MATLAB ignores any extra characters.
WORKSPACE
You can put several commands on the same line if you separate page 13
them with a comma if you want to see the results of the previous
command or semicolon if you want to suppress the display. For example,
Note that the first value of x was not displayed. Note also that the value of x
changed from 2 to 15.
If you need to type a long line, you can use an ellipsis, by typing three
periods, to delay execution. For example,
Tab Completion
MATLAB suggests corrections for syntax errors, which are incorrect
expressions in the MATLAB language. Suppose you mistakenly typed the
line
If you pressed Enter, MATLAB responds with an error message and asks if
you meant to type x = 1 + 2*(6+5). But if you did not yet press Enter,
instead of retyping the entire line, press the left-arrow key (←) several times
to move the cursor and add the missing t, then press Enter.
The left-arrow (←) and right-arrow (→) keys move left and right through
a line one character at a time. To move through one word at a time, press
Ctrl and → simultaneously to move to the right; press Ctrl and ←
simultaneously to move to the left. Press Home to move to the beginning of
a line; press End to move to the end of a line.
You can use the tab completion feature to reduce the amount of typing.
MATLAB automatically completes the name of a function, variable, or file if
you type the first few letters of the name and press the Tab key. If the name
is unique, it is automatically completed. For example, in the session listed
earlier, if you type Fruit and press Tab, MATLAB completes the name and
displays FruitPurchased. Press Enter to display the value of the variable,
or continue editing to create a new executable line that uses the variable
FruitPurchased. The tab completion feature also corrects for misspelling. If
you type fruit and press Tab, MATLAB correctly displays FruitPurchased.
If there is more than one name that starts with the letters you page 14
typed, MATLAB displays these names when you press the Tab key.
Use the mouse to select the desired name from the pop-up list by double-
clicking on its name.
Command History
The Pop-up Command History displays commands recently used in the
Command Window. By default it displays in response to the up-arrow (↑) in
the Command Window. You can use it for recalling, viewing, filtering, and
searching recently used commands in the Command Window To retrieve a
command in the list, use the up arrow key to highlight the desired command
and then press Enter, or use the mouse to select it. To retrieve a command
using a partial match, type any part of the command at the prompt, and then
press the up-arrow key. Marks the same color as error messages appear on
the left side of the Command History to indicate commands that generate
errors.
Deleting and Clearing
Press Del to delete the character at the cursor; press Backspace to page 15
delete the character before the cursor. Press Esc to clear the entire
line; press Ctrl and k simultaneously to delete (kill) to the end of the line.
MATLAB retains the last value of a variable until you quit MATLAB or
clear its value. Overlooking this fact commonly causes errors in MATLAB.
For example, you might prefer to use the variable x in a number of different
calculations. If you forget to enter the correct value for x, MATLAB uses the
last value, and you get an incorrect result. You can use the clear function to
remove the values of all variables from memory, or you can use the form
clear var1 var2 to clear the variables named var1 and var2. The effect of
the clc command is different; it clears the Command window of everything
in the window display, but the values of the variables remain.
You can type the name of a variable and press Enter to see its current
value. If the variable does not have a value (i.e., if it does not exist), you see
an error message. You can also use the exist function. Type exist('x') to see
if the variable x is in use. If a 1 is returned, the variable exists; a 0 indicates
that it does not exist. The who function lists the names of all the variables in
memory, but does not give their values. The form who var1 var2 restricts
the display to the variables specified. The wildcard character * can be used
to display variables that match a pattern. For instance, who A* finds all
variables in the current workspace that start with A. The whos function lists
the variable names and their sizes and indicates whether they have nonzero
imaginary parts.
The difference between a function and a command or a statement is that
functions have their arguments enclosed in parentheses. Commands, such as
clear, need not have arguments; but if they do, they are not enclosed in
parentheses, for example, clear x. Statements cannot have arguments; for
example, clc and quit are statements.
Press Ctrl-C to cancel a long computation without terminating the
session. You can quit MATLAB by typing quit. You can also click on the
File menu, and then click on Exit MATLAB.
Predefined Constants
MATLAB has several predefined special constants, such as the built-in
constant pi we used in Example 1.1–1. Table 1.1–4 lists them. The symbol
Discovering Diverse Content Through
Random Scribd Documents
ambition in this direction. In a council held at Rome in the year 769
this canon was passed: “Si quis ex episcopis … contra canonum et
sanctorum Patrum statuta prorumpens in gradum Majorum[98]
sanctæ Romanæ Ecclesiæ, id est presbyterorum cardinalium et
diaconorum, ire præsumpserit, … et hanc apostolicam sedem
invadere … tentaverit, et ad summum pontificalem honorem
ascendere voluerit, … fiat perpetuum anathema.”
There was at one period not a little divergence of opinion about
the precedence of cardinals over bishops; but the matter has long
ago been irrevocably settled. A cardinal, indeed, cannot, unless
invested with the episcopal character, perform any act that depends
for its validity upon such a character, nor can he lawfully invade the
jurisdiction of a bishop; but apart from this his rank in the church is
always, everywhere, and under all circumstances superior to that of
any bishop, archbishop, metropolitan, primate, or patriarch. Nor can
it be said that this is an anomaly, unless we are also prepared to
condemn other decisions of the church; for the precedence of
cardinals over bishops has a certain parity with that of the
archdeacons in old times over priests, which very example is brought
forward by Eugene IV. in 1431 to convince Henry, Archbishop of
Canterbury, who had a falling out with Cardinal John of Santa
Balbina: “Quoniam in hujusmodi prælationibus officium ac dignitas,
sive jurisdictio, præponderat ordini, quemadmodum jure cautum est
ut archidiaconus, non presbyter suæ jurisdictionis obtentu,
archipresbytero præferatur” (Bullarium Romanum, tom. iii.) But we
could bring a more cogent example from the modern discipline of
the church. A vicar-general, although only tonsured, outranks (within
the diocese) all others, because, as canonists say, unam personam
cum episcopo gerit; with as much justice, therefore, a cardinal, who
is a member of the pope, whose diocese is the world, precedes all
others (we speak of ecclesiastical rank) within mundane limits. There
is one example, particularly, in ecclesiastical history that shows us
how important was the influence of the Roman cardinals in the
whole church, and how great was the deference paid to them by
bishops. After the death of S. Fabian, in the year 250, the priests
and deacons—cardinals—of Rome governed the church for a year
during the vacancy of the see, and meanwhile wrote to S. Cyprian,
bishop, and to the clergy of Carthage, in a manner that could only
become a superior authority, as to how those should be treated who,
having lapsed from the faith during the persecution, now sought to
be reconciled. The holy bishop answered respectfully in an epistle
(xxth edition, Lipsiæ, 1838), in which he gave them an account of
his gests and government of the diocese. Pope Cornelius testifies
that the letters of the cardinals were sent to all parts to be
communicated to the bishops and churches (Coustant, Ep. RR. PP. x.
5). It is also very noteworthy that in the General Council of Ephesus,
in 431, of Pope Celestine’s three legates, the cardinal-priest
preceded the two others, although bishops, and before them signed
the acts. Those who say the Breviary according to the Roman
calendar are familiar with the fact that at an indefinitely early age
the cardinals were created (just as now) before the bishops of
various dioceses were named, hence those familiar words: “Mense
decembri creavit presbyteros (tot), diaconos (tot), episcopos per
diversa loca (tot).”
The importance of a cardinal a thousand years ago can be
imagined from the fact recorded by Muratori (Annali d’Italia, tom. v.
part. i. pag. 55), that when Anastasius had absented himself from
his title for five years without leave, and was residing in Lombardy,
three bishops went from Rome to invite him back, and the emperors
Louis and Lothaire also interposed their good offices.
Although all cardinals are equal among themselves in the principal
things, yet in many points of costume, privilege, local office, and
rank there are distinctions and differences established by law or
custom, the most important of which follow from the division of the
cardinals into three grades, namely, of bishops, priests, and deacons.
Although the whole number of suburbicarian sees, of titles, and
deaconries amounts to seventy-two (six for the first, fifty for the
second, and sixteen for the third class), the membership of the
Sacred College is limited since Sixtus V. to the maximum of seventy.
There can be no doubt that the episcopal sees lying nearest to, and,
so to speak, at, the very gates of Rome, have enjoyed from the
remotest antiquity some special pre-eminence; but it is not easy to
determine at what epoch their incumbents began to form a part of
the body of cardinals. It is certain only that they belonged to it in
the year 769. These suburban sees all received the faith from S.
Peter himself; and the tradition of Albano is that S. Clement, who
was afterwards pope, had been consecrated by the apostle and sent
there as his coadjutor and auxiliary. The number of these sees was
formerly seven, but for a long time has been only six. The Bishop of
Ostia and Velletri is the first of this order and Dean of the Sacred
College. He has the privilege of consecrating the pope, should he be
only in priest’s orders when elected, and of wearing the pallium on
the occasion.
The titles of the cardinal-priests are fifty, some being held by
persons who have been consecrated bishops but have no diocese, or
by jurisdictional bishops—i.e., those who are at the head of dioceses
and archdioceses. The most illustrious, though not the oldest, of
these is S. Lawrence in Lucina, which is called the first title, and
gives its cardinal precedence—other things being equal—in his class.
In the life of S. Fabian, who reigned in the year 238, we read that
he gave the districts of Rome in charge to the deacons: “Hic
regiones divisit diaconibus”; and these are supposed to have been
the first cardinal-deacons, or regionary cardinals, as they were long
called. This order is third in rank, but second in point of time when it
was admitted into the Sacred College. The number of cardinal-
deacons became fourteen (one for each of the civil divisions of the
city) towards the end of the VIth century, under the pontificate of S.
Gregory the Great. In the year 735 Pope Gregory III. added four and
raised the number to eighteen, which was reduced under Honorius
II., in the beginning of the XIIth century, to sixteen. After various
other mutations of number it was fixed as at present. Until the
pontificate of Urban II. in 1088 these cardinals were denominated by
the name of their district or region, except those added by Gregory
III., who were called palatines. After the XIth century they were
called from the name of their deaconries. S. Mary in Via Lata is the
first deaconry. The cardinal-deacons are often in priests’ orders; but
in this case they cannot celebrate Mass in public without a
dispensation from the Pope, but they can say it in their private
chapel in presence of their chaplain. In early times cardinal-deacons
held a position of very singular importance, and the pope was
frequently chosen from their restricted class. Even now some of the
highest positions at Rome are occupied by them.
Although a cardinal is created either a cardinal-priest or a cardinal-
deacon, there is a mode of advancement even to the chief
suburbicarian see. This is called, in the language of the Curia,
option, or the expressing a wish to pass from one order to a higher,
or from one deaconry, title, or see to another. The custom is
comparatively recent, and was looked upon at first with considerable
disfavor. It owes its origin to the schism which Alexander V.
attempted to heal in 1409 by forming one body of his own (the
legitimate) and of the pseudo-cardinals of the anti-pope Benedict
XIII. As there were two claimants to the several deaconries, titles,
and sees, he proposed to settle the dispute by permitting one of
them in succession to optate to the first vacant place in his order.
What was meant as a temporary measure became an established
custom under Sixtus IV. (1471-1484). If a cardinal-bishop be too
infirm to perform episcopal duties in the see which he already fills,
Urban VIII. decreed that he cannot pass to another one. If a
cardinal-deacon obtain by option a title before he has been ten years
in his own order, he must take the lowest place among the priests;
but if after that period, he takes precedence of all who have been
created in either of the two orders since his elevation. The favor of
option is asked of the pope in the consistory held next after a
vacancy has occurred, by the cardinal proposing such a change. The
prefect of pontifical ceremonies having previously assured himself
that no cardinal outranking the postulant contemplates the same,
the cardinal-priest, to give an example from this order, rises and
says: “Beatissime Pater, si sanctitati vestræ placuerit dimisso titulo
N. transitu ex ordine presbyterali ad episcopalem, opto ecclesiam
N.,” naming his title and the suburbicarian see that he seeks to
occupy.
These three orders of cardinals certainly had a corporate character
at an early period, and formed what the ancients called a college
with its officers and by-laws; but Arnulf, Bishop of Lisieux in the Xth
century, was the first to call them collectively Collegium Sanctorum;
hence in all languages it is now called the Sacred College. A proof
that the cardinals acted together in a public capacity, and of their
exalted dignity, is that they are termed Proceres clericorum by
Anastasius in the Life of S. Leo III. In olden times cardinals were
strictly obliged to reside near the pope; and a Roman council,
composed of sixty-seven bishops, held in 853 under S. Leo IV., called
in judgment and deposed the cardinal-priest of S. Marcellus for
having contumaciously absented himself during a long time from his
title. This obligation of residence in the house or palace annexed to
the title or the deaconry was somewhat relaxed in the XIIth century,
when bishops of actual jurisdiction began to be created cardinals.
The first example of a bishop governing a diocese who was made a
cardinal is that of Conrad von Wittelsbach, of the since royal house
of Bavaria, Archbishop of Mentz, who was raised to this dignity by
Alexander III. in 1163.
Innocent III., however, refused a petition of the good people of
Ravenna to let them have a certain cardinal for their archbishop,
saying that he was more useful to Rome and to the church at large
where he was than he could possibly be in any other position. At this
period, and until a considerable time after, it was very rare that a
bishop was made a cardinal without having to resign his diocese and
reside in curia.
Leo X. was so strict in his ideas of the duty of cardinals to live
near him that he issued a bull renewing the obligation in very strong
terms; and in 1538 it was proposed to Paul III. to draw up a plan of
reform making it incompatible to govern a diocese and be at the
same time a cardinal, except in the case of the Fathers of the First
Order, who, from the nearness of their sees to Rome, could perform
their service to the pope as his councillors and assistants, and not
neglect the faithful over whom they were placed (Natalis Alexander,
Hist. Eccl., tom. xvii. art. 16). No such stringent rule was adopted,
and a cardinal might be this and govern a diocese, if he made it his
place of habitual residence, according to the decree of the Council of
Trent (Session xxiii., on Ref., ch. 1).
Of the virtue, learning, and other qualities required in a cardinal of
the Holy Roman Church, SS. Peter Damian and Bernard have written
eloquently, and Honorius IV., of the great family of Savelli, once so
powerful in Rome, was inexorable against unworthy subjects, saying
that “he never would raise to the Roman purple any save good and
wise men.” Different popes have made excellent laws on these
matters and others connected with the cardinalate; but in some
cases they have been disregarded, especially those about age and
about there not being two near relatives in the Sacred College at the
same time. The practice of the last hundred years has been above
cavil, and the abuses of other ages have been exaggerated, partly
through malice, and partly from not knowing the secret reasons that
popes may have had for creating, for instance, mere youths—royal
youths—cardinals, or conferring the high dignity upon members of
their own family, or upon men who had nothing to recommend them
but the importunate demands of their sovereigns. The hat bestowed
upon S. Charles Borromeo was productive of more good than all the
rest of “nepotism” was able to effect of evil.
The creation of cardinals is an exclusive privilege of the popes; but
they have sometimes granted the prayers of the Sacred College or of
sovereign princes asking to have the dignity conferred upon certain
subjects. For a long time, especially during the XVIth century, the
governments of France, Spain, Portugal, Poland, and the republic of
Venice were favored by being permitted to name once in each
pontificate a candidate for the cardinalate. This was called a crown
nomination. Clement V. is said (Cancellieri, Mercato, p. 105, note 3)
to have been the first to grant to princes the right of petitioning for a
hat; and the sultan Bajazet II. wrote on 28th September, 1494, to
Alexander VI., begging him to make a perfect cardinal of Nicholas
Cibo, Archbishop of Aries, and cousin of Pope Innocent VIII. Clement
XII. in 1732 tendered to James III. (the “Elder Pretender”) the
nomination of some subject to the cardinalate, and he, like a true
Stuart, neglecting his countrymen and those who had suffered in his
cause, proposed Mgr. Rivera, whom he had taken a liking to for little
courtesies shown at Urbino. It has long been a custom for the pope
to promote to this dignity a member of the family or one of that
religious order to which his predecessor belonged, from whom he
himself received it. The Italians call this a restitution of the hat—
Restituzione di capello. The number of cardinals has greatly varied at
different times. It was generally smaller before than ever since the
XVIth century. The cardinals could, of course, well be all Romans, as
they were in the beginning; but with a change of circumstances the
pontiffs have recognized the propriety of S. Bernard’s suggestive
query to Eugene III.: “Annon eligendi de toto orbe, orbem
judicaturi?” (De Consid., iv. 4). In 1331 John XXII. (himself a
Frenchman), being asked by the king to create a couple of French
cardinals, replied that two were too many, and he would make but
one, because there were only twenty cardinals in all, and seventeen
of them were Frenchmen. In 1352, after the death of Clement VI.,
the cardinals attempted to restrict the Sacred College to twenty
members, on the principle that a dignity profusely conferred is
despised—communia vilescunt; but Urban VI. found himself
constrained, by the course of events at the schism, to create a large
number of cardinals, in order to oppose them to the pseudo-
cardinals of Clement VII., and at one creation he made twenty-nine,
all except three being his own countrymen, Neapolitans; so that the
French of another generation were richly paid back for their former
preponderance. From this time the membership of the Sacred
College gradually increased up to the middle of the XVIth century. It
is much to the credit of Pius II. that when the Sacred College in
1458 remonstrated with him on the number of cardinals, saying that
the cardinalate was going down, and begged him not to increase its
membership to any considerable extent, he told the fathers that as
head of the church he could not refuse the reasonable requests of
kings and governments in such a matter, but that, apart from this,
his honor forbade him to neglect the subjects of other countries than
Italy in the distribution of the highest favors in his gift (Comment. Pii
II., lib. ii. pp. 129, 130). Leo X., believing himself disliked by many
cardinals, added thirty-one to their number at a single creation on
July 1, 1517, the like of which the court has never seen before or
after; but it had the desired effect. The Council of Trent ordained
(Sess. 24, De Ref., c. i.) concerning the subjects of the cardinalate
that “the Most Holy Roman Pontiff shall, as far as it can be
conveniently done, select (them) out of all the nations of
Christendom, as he shall find persons suitable.” This is not to be
understood, however worded, as more than a recommendation to
the pope. Paul IV. (Caraffa, 1555-59), a great reformer, after
consulting the Sacred College and long discussions, issued a bull
called the Compact—Compactum—in which he decreed that the
cardinals should not be more than forty; but his immediate
successor, Pius IV. (Medici), acting on the principle that one pope
cannot bind another in disciplinary matters, created forty-six. Sixtus
V. in 1585 fixed the number at seventy in imitation of the seventy
elders chosen to assist Moses; and since then all the popes have
respected this precedent. During the long reign of Pius VII.,
although, on account of the times, unable to hold a consistory for
many years, he created in all ninety-eight cardinals, and when he
died left ten in petto. Although, on the one hand, an excessive
number of cardinals would lessen the importance and lower the
dignity of the office, yet a very small number has occasioned long
and disedifying conclaves, whereby for months, and even years, the
Holy See has been vacant, to the great detriment of the church. This
was the case four times during the XIIIth century, and by a
coincidence, each time it was after a pope who was the fourth of his
name, viz., Celestine (1241), Alexander (1261), Clement (1268), and
Nicholas (1292).
The subject of this article has grown so much under our hands
that we are reluctantly compelled to defer a description of the
ceremonies attendant on the election of cardinals, etc., till the July
number of The Catholic World.
ON THE WAY TO LOURDES.
“Quacumque ingredimur, in aliquam historiam vestigium
ponimus.”—Cicero.
He wrote against priests and monks, but stuck to the royal party,
condemning all who revolted under pretext of religion. Perhaps the
most supportable of his works is that against the Spanish Inquisition
—a subject that never needs any sauce piquante. His Tragique Elégie
du jour de Saint Barthélemy affords an additional proof in favor of
the approximate number of one thousand victims at the deplorable
massacre of August 24, 1572.
As a proof of the tenacity with which the Agenais have clung to
past religious traditions and customs, we will cite the popular saying
that arose from the unusual dispensations granted during Lent by
Mgr. Hébert, the bishop of the diocese, in a time of great distress
after an unproductive year:
“En milo sept centz nau L’abesque d’Agen debenguèt Higounau”—
In 1709 the Bishop of Agen turned Huguenot!
Leaving Agen by the railway to Tarbes, we came in ten minutes to
Notre Dame de Bon Encontre—a spot to which all the sorrows and
fears and hopes of the whole region around are brought. This chapel
is especially frequented during the month of May, when one parish
after another comes here to invoke the protection of Mary. A
continual incense of prayer seems to rise on the sacred air from this
sweet woodland spire. A few houses cluster around the pretty
church, which is surmounted by a colossal statue of the Virgin
overlooking the whole valley and flooding it with peace, love, and
boundless mercy. The image of her who is so interwoven with the
great mysteries of the redemption can never be looked upon with
indifference or without profit. The soul that finds Mary in the tangled
grove of this sad world enters upon a “moonlit way of sweet
security.”
We next pass Astaffort, a little village perched on a hill overlooking
the river Gers, justifying its ancient device: Sta fortiter.[99] It played
an important part in the civil wars of the country. The Prince de
Condé occupied the place with four hundred men, and, attacked by
the royalists, they were all slain but the prince and his valet, who
made their escape. A cross marks the burial-place of the dead
behind the church of Astaffort, still known as the field of the
Huguenots.
Lectoure, like an eagle’s nest built on a cliff, is the next station,
and merits a short tarry; for, though fallen from its ancient grandeur,
it is a town full of historic interest, and contains many relics of the
past. It is a place mentioned by Cæsar and Pliny, and yet so small
that we wonder what it has been doing in the meantime. It was one
of the nine cities of Novempopulania, and in the IXth century still
boasted the Roman franchise, and was the centre of light and
legislation to the country around, on which it imposed its customs
and laws. It governed itself, lived its own individual life, unaffected
by the changes of surrounding provinces, and proudly styled itself in
its public documents “the Republic of Lectoure.” In the XIIth century
it was the stronghold of the Vicomtes de Lomagne; and when
Richard Cœur de Lion wished to bring Vivian II. of that house to
terms, he laid siege to Lectoure, which, though stoutly defended for
a time, was finally obliged to yield. In 1305 it belonged to the family
of Bertrand de Got (Pope Clement V.), which accounts for a bull of
his being dated at Lectoure. Count John of Armagnac married Reine
de Got, the pope’s niece, in 1311, and thus the city fell into the
hands of the haughty Armagnacs, who made it their capital. At this
time they were the mightiest lords of the South of France, and
seemed to have inherited the ancient glory of the Counts of
Toulouse. For a time they held the destiny of France itself in their
hands. For one hundred and fifty years they took a prominent part in
all the French wars. Their banner, with its lion rampant, floated on
every battle-field. Their war-cry—Armagnac!—resounded in the ears
of the Derbys and Talbots. It was an Armagnac that sustained the
courage of France after the surrender of King John at Poitiers; an
Armagnac that united all the South against the English in the Etats-
Généraux de Niort; and an Armagnac—Count Bernard VI.—who
maintained the equilibrium of France when Jean-sans-Peur of
Burgundy aimed at supremacy, and fell a victim to Burgundian
vengeance at Paris.
Lectoure gives proofs of its antiquity and the changes it has
passed through in the remains of its triple wall; its fountain of Diana;
the bronzes, statuettes, jewels, and old Roman votive altars, that are
now and then brought to light; its mediæval castle, and the
interesting old church built by the English during their occupancy,
with its massive square tower, whence we look off over the valley of
the Gers, with its orchards and vineyards and verdant meadows shut
in by wooded hills, and see stretching away to the south the
majestic outline of the Pyrenees.
At the west of Lectoure is the forest of Ramier, in the midst of
which once stood the Cistercian abbey of Bouillas—Bernardus valles
—founded in 1125, but now entirely destroyed.
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.
ebookluna.com