100% found this document useful (3 votes)
22 views

MATLAB Programming with Applications for Engineers 1st Edition Edition Stephen J. Chapman pdf download

The document provides information on various MATLAB programming resources, including textbooks and ebooks by Stephen J. Chapman and others. It highlights the availability of instant digital downloads in multiple formats for engineering applications. Additionally, it includes details about the author and the structure of the MATLAB programming book, emphasizing its educational content.

Uploaded by

galkabalga6e
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
22 views

MATLAB Programming with Applications for Engineers 1st Edition Edition Stephen J. Chapman pdf download

The document provides information on various MATLAB programming resources, including textbooks and ebooks by Stephen J. Chapman and others. It highlights the availability of instant digital downloads in multiple formats for engineering applications. Additionally, it includes details about the author and the structure of the MATLAB programming book, emphasizing its educational content.

Uploaded by

galkabalga6e
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

MATLAB Programming with Applications for

Engineers 1st Edition Edition Stephen J. Chapman


download

https://ebookname.com/product/matlab-programming-with-
applications-for-engineers-1st-edition-edition-stephen-j-chapman/

Get Instant Ebook Downloads – Browse at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

MATLAB Programming for Engineers 3rd Edition Stephen J.


Chapman

https://ebookname.com/product/matlab-programming-for-
engineers-3rd-edition-stephen-j-chapman/

C Programming for Scientists and Engineers with


Applications 1st Edition Rama Reddy

https://ebookname.com/product/c-programming-for-scientists-and-
engineers-with-applications-1st-edition-rama-reddy/

Introduction to MATLAB for Engineers 3rd Edition


William J. *Palm

https://ebookname.com/product/introduction-to-matlab-for-
engineers-3rd-edition-william-j-palm/

Clinical Psychology in Practice 1st Edition Susan


Llewelyn

https://ebookname.com/product/clinical-psychology-in-
practice-1st-edition-susan-llewelyn/
Handbook of Pediatric Obesity Clinical Management 1st
Edition Melinda S. Sothern

https://ebookname.com/product/handbook-of-pediatric-obesity-
clinical-management-1st-edition-melinda-s-sothern/

p Adic Functional Analysis proceedings of the sixth


international conference 1st Edition A.K. Katsaras

https://ebookname.com/product/p-adic-functional-analysis-
proceedings-of-the-sixth-international-conference-1st-edition-a-
k-katsaras/

Blowing Agents and Foaming Processes 2012 1st Edition


Smithers Rapra

https://ebookname.com/product/blowing-agents-and-foaming-
processes-2012-1st-edition-smithers-rapra/

Engineering economy 16th ed Edition Sullivan

https://ebookname.com/product/engineering-economy-16th-ed-
edition-sullivan/

Warehouse Management Automation and Organisation of


Warehouse and Order Picking Systems Intralogistik 1st
Edition Michael Ten Hompel

https://ebookname.com/product/warehouse-management-automation-
and-organisation-of-warehouse-and-order-picking-systems-
intralogistik-1st-edition-michael-ten-hompel/
Sebastian Ephemera 01 Anne Bishop

https://ebookname.com/product/sebastian-ephemera-01-anne-bishop/
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page ii

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page i

MATLAB®
Programming
with Applications
for Engineers

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page ii

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page iii

MATLAB®
Programming
with Applications
for Engineers
First Edition

Stephen J. Chapman
BAE Systems Australia

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page iv

MATLAB® Programming with Applications © 2013 Cengage Learning


for Engineers
ALL RIGHTS RESERVED. No part of this work covered by the copyright
Stephen J. Chapman
herein may be reproduced, transmitted, stored, or used in any form or by
Publisher, Global Engineering: Christopher any means graphic, electronic, or mechanical, including but not limited to
M. Shortt photocopying, recording, scanning, digitizing, taping, web distribution,
information networks, or information storage and retrieval systems, except
Senior Acquisitions Editor: Randall Adams
as permitted under Section 107 or 108 of the 1976 United States
Senior Developmental Editor: Hilda Gowans Copyright Act, without the prior written permission of the publisher.
Editorial Assistant: Tanya Altieri
Team Assistant: Carly Rizzo For product information and technology assistance, contact us at
Cengage Learning Customer & Sales Support, 1-800-354-9706.
Marketing Manager: Lauren Betsos
Media Editor: Chris Valentine For permission to use material from this text or product,
submit all requests online at www.cengage.com/permissions.
Content Project Manager: D. Jean Buttrom Further permissions questions can be emailed to
Production Service: RPK Editorial Services, Inc. [email protected].
Copyeditor: Shelly Gerger-Knechtl
Proofreader: Harlan James Library of Congress Control Number: 2011934123

Indexer: Shelly Gerger-Knechtl ISBN-13: 978-0-495-66807-7


Compositor: Integra Software Solutions ISBN-10: 0-495-66807-9
Senior Art Director: Michelle Kunkler
Internal Designer: Carmela Periera Cengage Learning
Cover Designer: Andrew Adams/4065042 200 First Stamford Place, Suite 400
Canada Inc. Stamford, CT 06902
USA
Cover Image: © ivn3da/Shutterstock;
© Martin Trajkovski/Shutterstock;
© Daisy Daisy/Shutterstock; Cengage Learning is a leading provider of customized learning solutions
© PhotoStocker/Shutterstock with office locations around the globe, including Singapore, the United
Rights Acquisitions Specialist: John Hill Kingdom, Australia, Mexico, Brazil, and Japan. Locate your local office at:
Text and Image Permissions Researcher: international.cengage.com/region.
Kristiina Paul
Senior First Print Buyer: Doug Wilke
Cengage Learning products are represented in Canada by
Nelson Education Ltd.

For your course and learning solutions, visit www.cengage.com/engineering.


Purchase any of our products at your local college store or at our preferred
online store www.cengagebrain.com.
MATLAB is a registered trademark of The MathWorks, Inc., 3 Apple Hill
Drive, Natick, MA.

Printed in the United States of America


1 2 3 4 5 6 7 13 12 11

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may be suppressed. Editorial
review has deemed that any suppressed content does not materially affect the overall learning experience. The publisher reserves the right to
remove content from this title at any time if subsequent rights restrictions require it. For valuable information on pricing, previous
editions, changes to current editions, and alternate formats, please visit www.cengage.com/highered to search by
ISBN#, author, title, or keyword for materials in your areas of interest.

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page v

This book is dedicated with love to my daughter Sarah Rivkah Chapman. As a student at
Swinburne University in Melbourne, she may actually wind up using it!

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page vi

About the Author

Stephen J. Chapman received a BS in Electrical Engineering from Louisiana State


University (1975), an MSE in Electrical Engineering from the University of
Central Florida (1979), and pursued further graduate studies at Rice University.
From 1975 to 1980, he served as an officer in the U.S. Navy, assigned to
teach Electrical Engineering at the U.S. Naval Nuclear Power School in Orlando,
Florida. From 1980 to 1982, he was affiliated with the University of Houston,
where he ran the power systems program in the College of Technology.
From 1982 to 1988 and from 1991 to 1995, he served as a Member of the
Technical Staff of the Massachusetts Institute of Technology’s Lincoln
Laboratory, both at the main facility in Lexington, Massachusetts, and at the field
site on Kwajalein Atoll in the Republic of the Marshall Islands. While there, he
did research in radar signal processing systems. He ultimately became the leader
of four large operational range instrumentation radars at the Kwajalein field site
(TRADEX, ALTAIR, ALCOR, and MMW).
From 1988 to 1991, Mr. Chapman was a research engineer in Shell
Development Company in Houston, Texas, where he did seismic signal process-
ing research. He was also affiliated with the University of Houston, where he con-
tinued to teach on a part-time basis.
Mr. Chapman is currently Manager of Systems Modeling and Operational
Analysis for BAE Systems Australia, in Melbourne, Australia. He is the leader of
a team that has developed a model of how naval ships defend themselves against
antiship missile attacks. This model contains more than 400,000 lines of
MATLABTM code written over more than a decade, so he has extensive practical
experience applying MATLAB to real-world problems.
Mr. Chapman is a Senior Member of the Institute of Electrical and Electronic
Engineers (and several of its component societies). He is also a member of the
Association for Computing Machinery and the Institution of Engineers (Australia).
vi

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page vii

Contents

Chapter 1 Introduction to MATLAB 1


1.1 The Advantages of MATLAB 2
1.2 Disadvantages of MATLAB 4
1.3 The MATLAB Environment 4
1.3.1 The MATLAB Desktop 4
1.3.2 The Command Window 6
1.3.3 The Command History Window 7
1.3.4 The Start Button 7
1.3.5 The Edit/Debug Window 9
1.3.6 Figure Windows 9
1.3.7 Docking and Undocking Windows 11
1.3.8 The MATLAB Workspace 11
1.3.9 The Workspace Browser 12
1.3.10 Getting Help 13
1.3.11 A Few Important Commands 15
1.3.12 The MATLAB Search Path 17
1.4 Using MATLAB as a Calculator 19
1.5 Summary 21
1.5.1 MATLAB Summary 22
1.6 Exercises 22

vii

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page viii

viii | Contents

Chapter 2 MATLAB Basics 25


2.1 Variables and Arrays 25
2.2 Creating and Initializing Variables in MATLAB 29
2.2.1 Initializing Variables in Assignment Statements 29
2.2.2 Initializing with Shortcut Expressions 32
2.2.3 Initializing with Built-in Functions 33
2.2.4 Initializing Variables with Keyboard Input 33
2.3 Multidimensional Arrays 35
2.3.1 Storing Multidimensional Arrays in Memory 37
2.3.2 Accessing Multidimensional Arrays with One Dimension 37
2.4 Subarrays 39
2.4.1 The end Function 39
2.4.2 Using Subarrays on the Left-hand Side of an Assignment
Statement 40
2.4.3 Assigning a Scalar to a Subarray 41
2.5 Special Values 42
2.6 Displaying Output Data 44
2.6.1 Changing the Default Format 44
2.6.2 The disp function 46
2.6.3 Formatted output with the fprintf function 46
2.7 Data Files 48
2.8 Scalar and Array Operations 50
2.8.1 Scalar Operations 51
2.8.2 Array and Matrix Operations 51
2.9 Hierarchy of Operations 54
2.10 Built-in MATLAB Functions 57
2.10.1 Optional Results 58
2.10.2 Using MATLAB Functions with Array Inputs 58
2.10.3 Common MATLAB Functions 58
2.11 Introduction to Plotting 60
2.11.1 Using Simple xy Plots 61
2.11.2 Printing a Plot 62
2.11.3 Exporting a Plot as a Graphical Image 62
2.11.4 Saving a Plot in a Figure File 63
2.11.5 Multiple Plots 63
2.11.6 Line Color, Line Style, Marker Style, and Legends 64
2.12 Examples 68
2.13 MATLAB Applications:Vector Mathematics 74
2.13.1 Vector Addition and Subtraction 76
2.13.2 Vector Multiplication 77
2.14 MATLAB Applications: Matrix Operations
and Simultaneous Equations 81
2.14.1 The Matrix Inverse 82

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page ix

Contents | ix

2.15 Debugging MATLAB Programs 84


2.16 Summary 86
2.16.1 Summary of Good Programming Practice 86
2.16.2 MATLAB Summary 87
2.17 Exercises 90

Chapter 3 Two-Dimensional Plots 103


3.1 Additional Plotting Features for Two-Dimensional Plots 103
3.1.1 Logarithmic Scales 104
3.1.2 Controlling x- and y-axis Plotting Limits 107
3.1.3 Plotting Multiple Plots on the Same Axes 110
3.1.4 Creating Multiple Figures 111
3.1.5 Subplots 111
3.1.6 Controlling the Spacing Between Points on a Plot 114
3.1.7 Enhanced Control of Plotted Lines 117
3.1.8 Enhanced Control of Text Strings 118
3.2 Polar Plots 121
3.3 Annotating and Saving Plots 123
3.4 Additional Types of Two-Dimensional Plots 126
3.5 Using the plot function with Two-Dimensional Arrays 131
3.6 Summary 133
3.6.1 Summary of Good Programming Practice 134
3.6.2 MATLAB Summary 134
3.7 Exercises 135

Chapter 4 Branching Statements and Program Design 139


4.1 Introduction to Top-Down Design Techniques 140
4.2 Use of Pseudocode 143
4.3 Relational and Logic Operators 144
4.3.1 Relational Operators 144
4.3.2 A Caution About The == And ⬃= Operators 146
4.3.3 Logic Operators 147
4.3.4 Logical Functions 151
4.4 Branches 153
4.4.1 The if Construct 154
4.4.2 Examples Using if Constructs 156
4.4.3 Notes Concerning the Use of if Constructs 162
4.4.4 The switch Construct 164
4.4.5 The try/catch Construct 166
4.5 More on Debugging MATLAB Programs 173
4.6 MATLAB Applications: Roots of Polynomials 178

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page x

x | Contents

4.7 Summary 181


4.7.1 Summary of Good Programming Practice 181
4.7.2 MATLAB Summary 182
4.8 Exercises 182

Chapter 5 Loops and Vectorization 189


5.1 The while Loop 189
5.2 The for Loop 195
5.2.1 Details of Operation 202
5.2.2 Vectorization: A Faster Alternative to Loops 204
5.2.3 The MATLAB Just-In-Time (JIT) Compiler 205
5.2.4 The break and continue Statements 208
5.2.5 Nesting Loops 210
5.3 Logical Arrays and Vectorization 212
5.3.1 Creating the Equivalent of if/else Constructs with
Logical Arrays 213
5.4 The MATLAB Profiler 215
5.5 Additional Examples 217
5.6 The textread Function 232
5.7 MATLAB Applications: Statistical Functions 234
5.8 MATLAB Applications: Curve Fitting and Interpolation 237
5.8.1 General Least-Squares Fits 237
5.8.2 Cubic Spline Interpolation 244
5.8.3 Interactive Curve-Fitting Tools 250
5.9 Summary 253
5.9.1 Summary of Good Programming Practice 254
5.9.2 MATLAB Summary 254
5.10 Exercises 255

Chapter 6 Basic User-Defined Functions 267


6.1 Introduction to MATLAB Functions 269
6.2 Variable Passing in MATLAB:The Pass-By-Value Scheme 274
6.3 Optional Arguments 285
6.4 Sharing Data Using Global Memory 290
6.5 Preserving Data Between Calls to a Function 298
6.6 MATLAB Applications: Sorting Functions 303
6.7 MATLAB Applications: Random Number Functions 305
6.8 Summary 306
6.8.1 Summary of Good Programming Practice 306
6.8.2 MATLAB Summary 306
6.9 Exercises 307

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page xi

Contents | xi

Chapter 7 Advanced Features of User-Defined


Functions 317
7.1 Function Functions 317
7.2 Subfunctions and Private Functions 321
7.2.1 Subfunctions 322
7.2.2 Private Functions 323
7.2.3 Order of Function Evaluation 324
7.3 Function Handles 324
7.3.1 Creating and Using Function Handles 324
7.4 Anonymous Functions 327
7.5 Recursive Functions 328
7.6 Plotting Functions 329
7.7 Histograms 332
7.8 Summary 337
7.8.1 Summary of Good Programming Practice 337
7.8.2 MATLAB Summary 337
7.9 Exercises 338

Chapter 8 Complex Numbers and 3D Plots 345


8.1 Complex Data 345
8.1.1 Complex Variables 347
8.1.2 Using Complex Numbers with Relational Operators 348
8.1.3 Complex Functions 348
8.1.4 Plotting Complex Data 354
8.2 Multidimensional Arrays 358
8.3 Three-Dimensional Plots 360
8.3.1 Three-Dimensional Line Plots 360
8.3.2 Three-Dimensional Surface, Mesh, and Contour Plots 362
8.3.3 Creating Three-Dimensional Objects using Surface and
Mesh Plots 367
8.4 Summary 370
8.4.1 Summary of Good Programming Practice 370
8.4.2 MATLAB Summary 371
8.5 Exercises 371

Chapter 9 Cell Arrays, Structures, and Importing Data 375


9.1 Cell Arrays 375
9.1.1 Creating Cell Arrays 377
9.1.2 Using Braces {} as Cell Constructors 379
9.1.3 Viewing the Contents of Cell Arrays 379

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page xii

xii | Contents

9.1.4 Extending Cell Arrays 380


9.1.5 Deleting Cells in Arrays 382
9.1.6 Using Data in Cell Arrays 383
9.1.7 Cell Arrays of Strings 383
9.1.8 The Significance of Cell Arrays 384
9.1.9 Summary of cell Functions 388
9.2 Structure Arrays 388
9.2.1 Creating Structure Arrays 390
9.2.2 Adding Fields to Structures 392
9.2.3 Removing Fields from Structures 392
9.2.4 Using Data in Structure Arrays 393
9.2.5 The getfield and setfield Functions 394
9.2.6 Dynamic Field Names 395
9.2.7 Using the size Function with Structure Arrays 397
9.2.8 Nesting Structure Arrays 397
9.2.9 Summary of structure Functions 398
9.3 Importing Data into MATLAB 403
9.4 Summary 405
9.4.1 Summary of Good Programming Practice 406
9.4.2 MATLAB Summary 406
9.5 Exercises 406

Chapter 10 Handle Graphics and Animation 411


10.1 Handle Graphics 411
10.1.1 The MATLAB Graphics System 411
10.1.2 Object Handles 413
10.1.3 Examining and Changing Object Properties 413
10.1.4 Using set to List Possible Property Values 420
10.1.5 Finding Objects 422
10.1.6 Selecting Objects with the Mouse 424
10.2 Position and Units 426
10.2.1 Positions of figure Objects 427
10.2.2 Positions of axes Objects 428
10.2.3 Positions of text Objects 428
10.3 Printer Positions 431
10.4 Default and Factory Properties 431
10.5 Graphics Object Properties 434
10.6 Animations and Movies 434
10.6.1 Erasing and Redrawing 434
10.6.2 Creating a Movie 439
10.7 Summary 441
10.7.1 Summary of Good Programming Practice 441
10.7.2 MATLAB Summary 442
10.8 Exercises 442

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page xiii

Contents | xiii

Chapter 11 More MATLAB Applications 447


11.1 Solving Systems of Simultaneous Equations 447
11.1.1 Possible Solutions of Simultaneous Equations 449
11.1.2 Determining the Existence and Uniqueness of Solutions 451
11.1.3 Well-Conditioned Versus Ill-Conditioned Systems of Equations 452
11.1.4 Solving Systems of Equations with Unique Solutions 454
11.1.5 Solving Systems of Equations with an Infinite Number of
Solutions 456
11.1.6 Solving Overdetermined Systems of Equations 460
11.2 Differences and Numerical Differentiation 463
11.3 Numerical Integration—Finding the Area Under a Curve 466
11.4 Differential Equations 472
11.4.1 Deriving Differential Equations for a System 473
11.4.2 Solving Ordinary Differential Equations in MATLAB 476
11.4.3 Applying ode45 to Solve for the Voltage in a Circuit 480
11.4.4 Solving Systems of Differential Equations 482
11.4.5 Solving Higher Order Differential Equations 486
11.4.6 Stiff Differential Equations 489
11.5 Summary 490
11.5.1 Summary of Good Programming Practice 491
11.5.2 MATLAB Summary 492
11.6 Exercises 492

Appendix A ASCII Character Set 499

Appendix B Additional MATLAB Input/Output


Functions 501
B.1 MATLAB File Processing 501
B.2 File Opening and Closing 503
B.2.1 The fopen Function 503
B.2.2 The fclose Function 505
B.3 Binary I/O Functions 506
B.3.1 The fwrite Function 506
B.3.2 The fread Function 507
B.4 Formatted I/O Functions 510
B.4.1 The fprintf Function 510
B.4.2 Understanding Format Conversion Specifiers 512
B.4.3 The fscanf Function 514
B.4.4 The fgetl Function 516
B.4.5 The fgets Function 516
B.5 The textscan Function 516

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page xiv

xiv | Contents

Appendix C Working with Character Strings 519


C.1 String Functions 519
C.1.1 String Conversion Functions 520
C.1.2 Creating Two-Dimensional Character Arrays 520
C.1.3 Concatenating Strings 521
C.1.4 Comparing Strings 521
C.1.5 Searching and Replacing Characters within a String 525
C.1.6 Uppercase and Lowercase Conversion 526
C.1.7 Trimming Whitespace from Strings 527
C.1.8 Numeric-to-String Conversions 527
C.1.9 String-to-Numeric Conversions 529
C.1.10 Summary 530
C.2 Summary 536
C.2.1 Summary of Good Programming Practice 536
C.2.2 MATLAB Summary 537
C.3 Exercises 538

Appendix D Answers to Quizzes 539

Index 555

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page xv

Preface

MATLAB® (short for MATrix LABoratory) is a special-purpose computer pro-


gram optimized to perform engineering and scientific calculations. It started life
as a program designed to perform matrix mathematics, but over the years it has
grown into a flexible computing system capable of solving essentially any tech-
nical problem.
The MATLAB program implements the MATLAB language and provides a
very extensive library of pre-defined functions to make technical programming
tasks easier and more efficient. This extremely wide variety of functions makes it
much easier to solve technical problems in MATLAB than in other languages
such as Java, Fortran, or C⫹⫹. This book introduces the MATLAB language, and
shows how to use it to solve typical technical problems.
This book seeks to simultaneously teach MATLAB as a technical program-
ming language and also to introduce the student to many of the practical functions
that make solving problems in MATLAB so much easier than in other languages.
The book provides a complete introduction to the fundamentals of good proce-
dural programming, developing good design habits that will serve a student well
in any other language that he or she may pick up later. There is a very strong
emphasis on proper program design and structure. A standard program design
process is introduced at the beginning of Chapter 4 and then followed regularly
throughout the remainder of the text.
In addition, the book uses the programming topics and examples as a jumping
off point for exploring the rich set of highly optimized application functions that are
built directly into MATLAB. For example, in Chapter 4 we present a programming
example that finds the roots of a quadratic equation. This serves as a jumping off
point for exploring the MATLAB function roots, which can efficiently find the

xv

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page xvi

xvi | Preface

roots of polynomials of any order. In Chapter 5, we present a programming exam-


ple that calculates the mean and standard deviation of a data set. This serves as a
jumping off point for exploring the MATLAB functions mean, median, and std.
There is also a programming example showing how to do a least-squares fit to a
straight-line. This serves as a jumping off point for exploring MATLAB curve fit-
ting functions such as polyfit, polyval, spline, and ppval. There are sim-
ilar ties to MATLAB applications in many other chapters as well. In all cases, there
are end of chapter exercises to reinforce the applications lessons learned in that
chapter.
In addition, Chapter 11 is devoted totally to practical MATLAB applica-
tions, including solving systems of simultaneous equations, numerical differen-
tiation, numerical integration (quadrature), and solving ordinary differential
equations.
This book makes no pretense at being a complete description of all of
MATLAB’s hundreds of functions. Instead, it teaches the student how to use
MATLAB as a language to solve problems, and how to locate any desired function
with MATLAB’s extensive on-line help facilities. It highlights quite a few of the
key engineering applications, but there are far more good ones built into the lan-
guage than can be covered in any course of reasonable length. With the skills
developed here, students will be able to continue discovering features on their own.

The Advantages of MATLAB for Problem Solving


MATLAB has many advantages compared to conventional computer languages
for technical problem solving. Among them are:
1. Ease of Use. MATLAB is very easy to use. The program can be used as
a scratch pad to evaluate expressions typed at the command line, or it can
be used to execute large pre-written programs. Programs may be easily
written and modified with the built-in integrated development environ-
ment, and debugged with the MATLAB debugger. Because the language
is so easy to use, it is ideal for educational use, and for the rapid proto-
typing of new programs.
Many program development tools are provided to make the program
easy to use. They include an integrated editor / debugger, on-line docu-
mentation and manuals, a workspace browser, and extensive demos.
2. Platform Independence. MATLAB is supported on many different com-
puter systems, providing a large measure of platform independence. At
the time of this writing, the language is supported on Windows
XP/Vista/7, Linux, Unix, and the Macintosh. Programs written on any
platform will run on all of the other platforms, and data files written on
any platform may be read transparently on any other platform. As a result,
programs written in MATLAB can migrate to new platforms when the
needs of the user change.

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page xvii

Preface | xvii

3. Pre-defined Functions. MATLAB comes complete with an extensive


library of pre-defined functions that provide tested and pre-packaged
solutions to many basic technical tasks. For example, suppose that you are
writing a program that must calculate the statistics associated with an
input data set. In most languages, you would need to write your own sub-
routines or functions to implement calculations such as the arithmetic
mean, standard deviation, median, etc. These and hundreds of other func-
tions are built right into the MATLAB language, making your job much
easier.
The built-in functions can solve an astonishing range of problems,
such as solving systems of simultaneous equations, sorting, plotting, find-
ing roots of equations, numerical integration, curve fitting, solving ordi-
nary and partial differential equations, and much, much more.
In addition to the large library of functions built into the basic MAT-
LAB language, there are many special-purpose toolboxes available to help
solve complex problems in specific areas. For example, a user can buy
standard toolboxes to solve problems in Signal Processing, Control
Systems, Communications, Image Processing, and Neural Networks,
among many others.
4. Device-Independent Plotting. Unlike other computer languages, MAT-
LAB has many integral plotting and imaging commands. The plots and
images can be displayed on any graphical output device supported by
the computer on which MATLAB is running. This capability makes
MATLAB an outstanding tool for visualizing technical data. Plotting is
introduced in Chapter 2, and covered extensively in Chapters 3 and 8.
Advanced features such as animations and movies are covered in
Chapter 10.
5. Graphical User Interface. MATLAB includes tools that allow a pro-
gram to interactively construct a Graphical User Interface (GUI) for his
or her program. With this capability, the programmer can design sophis-
ticated data analysis programs that can be operated by relatively-inexpe-
rienced users.

Features of this Book


Many features of this book are designed to emphasize the proper way to write
reliable MATLAB programs. These features should serve a student well as he or
she is first learning MATLAB, and should also be useful to the practitioner on the
job. They include:
1. Emphasis on Top-Down Design Methodology. The book introduces a
top-down design methodology in Chapter 4, and then uses it consistently
throughout the rest of the book. This methodology encourages a student

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page xviii

xviii | Preface

to think about the proper design of a program before beginning to code. It


emphasizes the importance of clearly defining the problem to be solved
and the required inputs and outputs before any other work is begun. Once
the problem is properly defined, it teaches the student to employ stepwise
refinement to break the task down into successively smaller sub-tasks,
and to implement the subtasks as separate subroutines or functions.
Finally, it teaches the importance of testing at all stages of the process,
both unit testing of the component routines and exhaustive testing of the
final product.
The formal design process taught by the book may be summarized as follows:
1. Clearly state the problem that you are trying to solve.
2. Define the inputs required by the program and the outputs to be produced
by the program.
3. Describe the algorithm that you intend to implement in the program. This
step involves top-down design and stepwise decomposition, using
pseudocode or flow charts.
4. Turn the algorithm into MATLAB statements.
5. Test the MATLAB program. This step includes unit testing of specific
functions, and also exhaustive testing of the final program with many dif-
ferent data sets.
2. Emphasis on Functions. The book emphasizes the use of functions to
logically decompose tasks into smaller subtasks. It teaches the advantages
of functions for data hiding. It also emphasizes the importance of unit
testing functions before they are combined into the final program. In addi-
tion, the book teaches about the common mistakes made with functions,
and how to avoid them.
3. Emphasis on MATLAB Tools. The book teaches the proper use of
MATLAB’s built-in tools to make programming and debugging easier.
The tools covered include the Editor / Debugger, Workspace Browser,
Help Browser, and GUI design tools.
4. Emphasis on MATLAB applications. The book teaches how to harness
the power of MATLAB’s rich set of functions to solve a wide variety of
practical engineering problems. This introduction to MATLAB functions
is spread throughout the book, and is generally tied to the topics and
examples being discussed in a particular chapter.
5. Good Programming Practice Boxes. These boxes highlight good pro-
gramming practices when they are introduced for the convenience of the
student. In addition, the good programming practices introduced in a
chapter are summarized at the end of the chapter. An example Good
Programming Practice Box is shown below.

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page xix

Preface | xix

✷ Good Programming Practice:


Always indent the body of an if construct by 2 or more spaces to improve the
readability of the code.

6. Programming Pitfalls Boxes


These boxes highlight common errors so that they can be avoided. An
example Programming Pitfalls Box is shown below.

 Programming Pitfalls:
Make sure that your variable names are unique in the first 63 characters. Otherwise,
MATLAB will not be able to tell the difference between them.

Pedagogical Features
This book includes several features designed to aid student comprehension. A
total of 13 quizzes appear scattered throughout the chapters, with answers to all
questions included in Appendix D. These quizzes can serve as a useful self-test of
comprehension. In addition, there are approximately 215 end-of-chapter exercis-
es. Answers to all exercises are included in the Instructor’s Manual. Good pro-
gramming practices are highlighted in all chapters with special Good
Programming Practice boxes, and common errors are highlighted in
Programming Pitfalls boxes. End of chapter materials include Summaries of
Good Programming Practice and Summaries of MATLAB Commands and
Functions.
The book is accompanied by an Instructor’s Manual, containing the solutions
to all end-of-chapter exercises. The IM, PowerPoint slides of all figures and tables
in the book and the source code for all examples in the book is available from the
book’s Web site, and the source code for all solutions in the Instructor’s Manual
is available separately to instructors.
To access additional course materials [including CourseMate], please visit
www.cengagebrain.com. At the cengagebrain.com home page, search for the
ISBN of your title (from the back cover of your book) using the search box at the
top of the page. This will take you to the product page where these resources can
be found.

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_00_fm_pi-xx.qxd 9/2/11 1:49 PM Page xx

xx | Preface

A Thank You to the Reviewers


I would like to offer a special thank you to the book’s reviewers. Their invaluable
suggestions have made this a significantly better book, and they certainly deserve
thanks for the time they devoted to reviewing drafts of the text. The reviewers who
were willing to be named are:
Steven A. Peralta, University of New Mexico
Jeffrey Ringenberg, University of Michigan
Lizzie Santiago, West Virginia University
John R. White, University of Massachusetts, Lowell

A Final Note to the User


No matter how hard I try to proofread a document like this book, it is inevitable
that some typographical errors will slip through and appear in print. If you should
spot any such errors, please drop me a note via the publisher, and I will do my
best to get them eliminated from subsequent printings and editions. Thank you
very much for your help in this matter.
I will maintain a complete list of errata and corrections at the book’s World
Wide Web site, which is http://www.cengage.com/engineering. Please check that
site for any updates and/or corrections.

STEPHEN J. CHAPMAN
Melbourne, Australia

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_01_ch01_p001-024.qxd 9/2/11 12:46 PM Page 1

C H A P T E R 1
Introduction
to MATLAB

MATLAB (short for MATrix LABoratory) is a special-purpose computer program


optimized to perform engineering and scientific calculations. It started life as a
program designed to perform matrix mathematics, but over the years, it has
grown into a flexible computing system capable of solving essentially any techni-
cal problem.
The MATLAB program implements the MATLAB programming language and
provides an extensive library of predefined functions to make technical pro-
gramming tasks easier and more efficient.This book introduces the MATLAB lan-
guage as it is implemented in MATLAB Version 7.9 and shows how to use it to
solve typical technical problems.
MATLAB is a huge program, with an incredibly rich variety of functions. Even
the basic version of MATLAB without any toolkits is much richer than other
technical programming languages. There are more than 1000 functions in the
basic MATLAB product alone, and the toolkits extend this capability with many
more functions in various specialties. Furthermore, these functions often solve
very complex problems (solving differential equations, inverting matrices, and so
forth) in a single step, saving large amounts of time. Doing the same thing in
another computer language usually involves writing complex programs yourself
or buying a third-party software package (such as IMSL or the NAG software
libraries) that contains the functions.
The built-in MATLAB functions are almost always better than anything that
an individual engineer could write on his or her own, because many people have
worked on them and they have been tested against many different data sets.
These functions are also robust, producing sensible results for wide ranges of
input data and gracefully handling error conditions.

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
68077_01_ch01_p001-024.qxd 9/2/11 12:46 PM Page 2

2 | Chapter 1 Introduction to MATLAB

This book makes no attempt to introduce the user to all of MATLAB’s func-
tions. Instead, it teaches a user the basics of how to write, debug, and optimize good
MATLAB programs and provides a subset of the most important functions used to
solve common scientific and engineering problems. Just as importantly, it teaches the
scientist or engineer how to use MATLAB’s own tools to locate the right function
for a specific purpose from the enormous amount of choices available. In addition,
it teaches how to use MATLAB to solve many practical engineering problems, such
as vector and matrix algebra, curve fitting, differential equations, and data plotting.
The MATLAB program is a combination of a procedural programming
language, an integrated development environment (IDE) including an editor and
debugger, and an extremely rich set of functions that can perform many types of
technical calculations.
The MATLAB language is a procedural programming language, meaning that
the engineer writes procedures, which are effectively mathematical recipes for
solving a problem. This makes MATLAB very similar to other procedural
languages such as C, Basic, Fortran, and Pascal. However, the extremely rich list
of predefined functions and plotting tools makes it superior to these other
languages for many engineering analysis applications.

1.1 The Advantages of MATLAB


MATLAB has many advantages compared to conventional computer languages
for technical problem solving. Among them are:
1. Ease of Use
MATLAB is an interpreted language, like many versions of Basic, and
like Basic, it is very easy to use. The program can be used as a scratch
pad to evaluate expressions typed at the command line, or it can be used
to execute large prewritten programs. Programs may be easily written
and modified with the built-in integrated development environment and
can be debugged with the MATLAB debugger. Because the language is
so easy to use, it is ideal for the rapid prototyping of new programs.
Many program development tools are provided to make the program
easy to use. They include an integrated editor/debugger, on-line docu-
mentation and manuals, a workspace browser, and extensive demos.
2. Platform Independence
MATLAB is supported on many different computer systems, providing a
large measure of platform independence. At the time of this writing, the
language is supported on Windows XP/Vista/7, Linux, Unix, and the
Macintosh. Programs written on any platform will run on all of the other
platforms, and data files written on any platform may be read transpar-
ently on any other platform. As a result, programs written in MATLAB
can migrate to new platforms when the needs of the user change.

Copyright 2012 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has
deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Another Random Document on
Scribd Without Any Related Topics
“And,” I broke in sternly, “you, sir, filled the room with a
‘knock out’ of dirty, hungry aliens from Whitechapel; and,
when I grew dangerous, you and your friends did not
scruple to hound me down and kidnap me. That was the
way you put me out of competition and snatched your
beggarly triumph, but you know as well as I do that I am
ignorant of the precise contents or qualities of the
documents which I was employed to make such a strenuous
battle for.”

“But, sir,” he sneered, rolling back his lips and showing his
toothless gums, “think of that beautiful sign outside your
office: ‘Mr Hugh Glynn, Secret Investigator!’ why, nothing
should be hidden from you!” And he threw out his hands
with a gesture of infinite comprehensiveness and burst into
a loud and offensive mocking laugh.

“Nor will this thing be a mystery to me long,” I retorted


boldly, rising and striking the top of the table with my
clenched fist. “You, Peter Zouche, understand that! At
present I am merely a private soldier obeying the orders of
a superior officer, but, by heaven! if it were not so, and I
were free to handle this affair in the manner that suited me
best, do you fancy you would be able to play with me like
you did at the auction mart in Covent Garden, that I would
walk meekly out of your shop after I had been kicked and
buffeted and imprisoned, and that I would come here
almost immediately afterwards and let you do your level
best to jeer at me and sneer at me and treat me as a dolt
or a child? No!” I thundered, “ten thousand thousand times
no!

“Luckily,” I went on in a more subdued voice, “fate has


given me a share in this mystery, and as soon as I am free
of all the honourable obligations which I have undertaken
you may be sure I shall be here to be reckoned with.
Sooner or later I will make you bitterly regret this cheap
scoffing of yours at my qualifications as a professional
detective. I know that wonderful secrets about buried
treasures and compacts between states and churches and
individuals, lie hidden in those old manuscript deeds that
are often left kicking about as so much idle lumber in garret
and cellar and office. Nobody in London, indeed, knows
better; and I will track this precious secret of yours down—”

“Enough,” struck in Cooper-Nassington in his most terrible


tones. “You, Glynn, have now justified yourself. It’s the
hunchback’s turn. Once again I demand of him: What has
he deciphered from those three queer-looking manuscripts
which he purchased this afternoon?”

Peter Zouche faltered; to my astonishment I saw that he


had been conquered.

“You know well enough what they contain,” he snarled, “or


you would not be here at this hour, and in this mood!”

“And so do you, you wicked old cripple,” roared my friend,


“or you would never have spent all that money on packing
that auction mart with your gang of foreign mercenaries to
effect a knock-out of the manuscripts; you are not the kind
of philanthropist who throws away two or three thousand
pounds on the relatives of a poor Spanish priest whom you
have never set eyes on. So speak out without any more
fuss. Are they what I have been led to expect?”

“They are,” the hunchback muttered, licking his dry and


feverish lips; “but it will take me two or three weeks to
decode them. I was looking at them when you came and
knocked at the door with that cursed all-compelling signal
of yours. Why the deuce didn’t you leave me in peace for a
time?”
“Because I wanted to be sure I had been correctly informed,
of course,” retorted the Member of Parliament gaily, rising
and brushing the cigar ash off his waistcoat. “In fact, in a
word, I shall assume now that you have got possession of
the documents that give the key to the position and the
drainage of the Lake of Sacred Treasure in Tangikano, which
was for centuries the depository of the treasures of the
original tribes of Mexico, and which has been believed
always, upon quite credible evidence, to contain gold and
precious stones to the amount of many millions sterling.”

“Yes; that is so,” conceded Zouche, with a sigh.

“What!” I cried, unable to stifle my excitement at hearing


this extraordinary piece of news. “Do you mean to say there
has been discovered at last that wonderful Mexican lake
over which England nearly went to war with Spain in the
days of Elizabeth, a secret that was supposed to be known
only to the Jesuits, who lost in some miraculous fashion all
the documents bearing on the subject nearly three hundred
years ago?”

“I do,” replied the hunchback. “What did you think when I


took such extraordinary precautions at the auction this
afternoon?—that I was simply playing up for some quaint
and curious cryptogram? Bah! men of my reputation don’t
fling one thousand eight hundred pounds about for childish
puzzles like those.”

“So I might have guessed,” I added to myself a little


bitterly. “I ought to have realised something of the sort was
afoot, but, as you know, we collectors of manuscripts have
known so long about these wonderful missing records that
we have actually grown tired of looking out for them, and
some of the best and wisest of us have gone so far as to
doubt their very existence.”
“Well, you need not,” observed the Member of Parliament
genially, fixing his hat upon his head firmly. “Prescott, in his
‘Conquest of Mexico,’ sets out the facts about the Lake of
Sacred Treasure in Tangikano with great clearness. I
remember, very well, he explains that it must be
somewhere about the centre of the uninhabited portion of
Mexico and that its dimensions are not too formidable to
tackle for unwatering, being about only one thousand two
hundred feet long by one thousand feet wide on the
surface, but the greatest depth has not been fathomed. It is
known to stand at a height of about ten thousand feet
above sea level. Indeed, its depths are reputed to have
been regarded as sacred to their gods by a numerous
aboriginal population long before the appearance of the
Jesuits in that part of the world.”

“But why,” I queried, “is the value of its treasure always so


firmly insisted on?”

“Because,” replied he, “in connection with their religious


rites the aboriginals habitually made offerings to the deities
of the lake in the form of gold dust, golden images, and
emeralds, the most famous emerald mines of the world
being situated in the heart of Mexico. Indeed, Prescott says
that this particular gem was held as sacred by the early
tribes inhabiting Mexico as being the emblem of the sun,
they themselves being sun-worshippers. More than that,
their king, who was also their pontiff, was in the habit of
being completely covered with gold dust so applied as to
cause him to shine with great lustre like the rays of the sun.
In brief, he was the real ‘El Dorado’ of whom we have heard
so much and seen so little; and, as his principal religious
ceremony, he was wont to perform his ablutions from a raft
in the centre of the lake, until the whole of the precious
metal was washed away. This accomplished, the king, and
the chiefs who were with him, made a rule of throwing
costly offerings into the water.”

“Better than that,” struck in the hunchback, almost with


enthusiasm, “I have just been turning over an article in the
South American Journal on this very subject, and I read
there that the multitude of worshippers, thereupon, likewise
cast in their humbler contributions in the midst of singing
and dancing and to the sound of such musical instruments
as were available. When the ‘bearded men’ reached the
country it is stated that the Indians, to put their treasure
beyond the power of the ruthless invaders, threw it into the
waters of the lake to a vast value; and, indeed, an attempt
was made by the Spaniards to unwater it, so as to get at
the submerged accumulation of gold dust and precious
stones. They were not able to reach the bottom, but
succeeded in lowering the water to such an extent as to
expose a portion of the margins of the lake, whence they
obtained sufficient to pay to the Spanish Government one
hundred and seventy thousand dollars, equivalent to three
per cent, on a total recovered of five millions six hundred
thousand dollars. There were also emeralds, one of which
realised seventy thousand dollars in Madrid. Further
progress was arrested by the sides of the cutting on the lip
of the lake-cup falling in with a tremendous crash. The
water poured into the mouth of an adjacent volcano, and a
terrible earthquake resulted, before which the Spaniards
and their Jesuit friends fled in terror. A proper record was,
however, made later on of the exact position of the lake,
but, as Mr Cooper-Nassington explained, it was lost.”

“And you have recovered it,” I burst out.

“That is so; but although repeated expeditions were made


to the district, which is largely of volcanic origin, to discover
it without the key I possess, they all failed; and as the
years slipped on they grew fewer and fewer in number until,
as you have heard for yourself, the whole thing has just
become a will-o’-the-wisp of the manuscript hunter who, of
course, has mostly grown to feel he is as likely to discover
the missing documents as he is to find the title-deeds of the
temple of David.

“But,” said the hunchback, suddenly changing his tone and


confronting my companion with an angry look, “none of this
is to the point. It is, in a way, all so much ancient history
and as familiar to men like yourself, who rule Mexico
through the Stock Exchange or our British Foreign Office, as
your alphabet. What I want to know is: What business is it
of yours what I have bought and what I have discovered?
You have no share in this find. You have no right to
information. By what right do you come here demanding to
know what I have learned, and shall learn, with infinite
patience, expense, and labour?”

“All that in good time, my dear sir,” calmly returned Cooper-


Nassington. “For the present it must be sufficient for you
that I have a very real and vital stake in what you have
found, and you had better treat me well over the business
when I come to you again after you have deciphered the
manuscripts, or you’ll live to regret the day I was born.”

For a second the two men stood glaring at each other in


angry defiance, but again I saw that the millionaire won.
Whatever was the mysterious hold he had over the
hunchback there was no doubt but that it was a very potent
and a very effective one, and that, however much Zouche
might kick and threaten, in the end he was bound to come
to the other’s heel.

“All right. Come to me in a fortnight’s time,” he growled,


“and I’ll see then what can be done. Don’t fancy, though,
that this business is simply fitting out a yacht with a party
of Cornish miners and engineers and going to take
possession of the loot.”

“I don’t,” said the Member of Parliament coolly; “there are


the Jesuits to reckon with.”

“Yes; but that’s not the worst,” retorted Zouche; “there are
others.”

“Others!” cried the man in astonishment. “What do you


mean?”

“Well, first, who was the man that put you on the track of
my discovery, eh? What, for instance, is the name or
position of Mr Glynn’s employer?”

In spite of myself I flushed and started. Should I now hear


who Don José Casteno really was, if he were really a friend
of Lord Cyril Cuthbertson, and why he was a resident at
that home of mystery, St. Bruno’s. Alas! no. I was doomed
to disappointment.

“We decline to tell you,” said my companion with great


firmness.

“I shall find out for myself,” roared the dwarf.

“Do, if you can,” returned the man coolly. “For the present,
stick to the point we are discussing. Who else have we to
fear?”

“The cut-throats who did this,” snarled the hunchback,


stepping quickly across the room and taking down a cloak
from the walls. Then he spread the garment out on the
table and indicated certain bullet holes in the back. “They
did this to me this afternoon as I walked homeward,” he
added. “The shots came just as I was crossing Westminster
Bridge. I searched everywhere for a sight of the man, who
must have done it with some new-fangled air-gun. I could
find none at all.

“Nor is that all,” he proceeded the next moment; “just cast


a glance in this direction, will you?” He stumbled across the
parlour to a point where stood an old oaken chest about two
feet high, the lid of which he threw back with a bang. “Do
you see that fine mastiff in there?” pointing to the shadowy
form of a huge dog in the depths of the chest. “Well, an
hour ago he was poisoned. By whom? For what? I have
lived here in this house, in this neighbourhood, for five and
forty years and nothing of the sort has ever occurred
before.

“Ten minutes before your carriage rattled up I had another


weird experience. Explain it if you can—I can’t. I was seated
at this very table poring over one of those precious
manuscripts, which I hide in a place practically inaccessible
to anybody except myself, when I became conscious I was
not alone. Somebody, I felt certain, had come mysteriously
on the scene and was watching me intently. I glanced up
suddenly, and found there, at that small casement window
which opens on the street, and which is usually guarded by
the shutter you now see placed in position, the face of a
man. ‘What do you want?’ I cried angrily, and darted across
the room to fling the shutter back into position with all the
force I could exert. But he was much too swift for me. With
incredible rapidity he flung an envelope through the opening
and darted off, and the shutter and window slammed
together, as I intended, but with an empty bang. The
scoundrel had escaped!

“Well, by that time I was accustomed to surprises, and so I


took up the envelope, which was of a cheap, inferior make,
similar to those sold by small stationers in poor districts. It
had no address upon it, but it was sealed. I tore it open,
and found inside a piece of paper bearing this message.”
After fumbling behind an ornament on the mantelpiece he
produced a slip that had been evidently torn out of some
child’s exercise book, and upon which was written in feigned
handwriting to resemble a schoolboy’s:

“Your secret is known. At the right moment I shall come to


you and claim it for its lawful owner. Meanwhile, breathe not
a word to a soul as you value your property and your life.”

“Of course,” added the hunchback, with a shrug of the


shoulders, “all this sounds the merest melodrama, and so it
may be. But you and I know quite enough of the
importance of those manuscripts to understand how many
rich and extraordinary personages in England, in Spain, in
Mexico have the keenest interest in their contents, their
recovery, and their translation. Your Lord Cyril Cuthbertson,
for one,” shot out Zouche, glancing at the millionaire with
eyes full of meaning, yet bright with the springs of his own
hidden resentment.

The Member of Parliament bit his lip. “Maybe, maybe,” he


said, but I could see the shot went home and that inwardly
he was much perturbed. “Still, you must do your best,
that’s all. Personally, I should say it is your friend, Lord
Fotheringay, who feels he can’t trust you, but, really, it is
your lookout. Come along, Glynn.” And he led the way
impatiently down the passage, and, before the dwarf could
say another word, he had hurried me out into Tufton Street,
which seemed still to be as deserted as the grave.

As we stepped out we heard the door close behind us; and,


remembering the mysterious letter which Don José had
instructed me to hand to Lord Cuthbertson in the case of
certain eventualities, I resolved on a bold step of my own.

“Why,” said I suddenly to my companion, “do you fear the


Secretary of State for Foreign Affairs getting wind of this
discovery of yours?”

Never shall I forget the effect of this apparently innocent


question of mine!

Never!
Chapter Seven.
In Stanton Street.

“Why am I afraid that the Secretary of State for Foreign


Affairs may get wind of the discovery of those manuscripts
which locate the exact whereabouts of the Lake of Sacred
Treasure in Mexico?” repeated the Member of Parliament
fiercely; and he came to a dead stop at the corner of the
turning into Peter Street.

“For the best of all reasons,” he snapped. “He is the one


man in the world I hate with all the force I am capable of.
He has proved himself my evil genius. In politics, in
preferment, in marriage he has beaten me every time we
have come into conflict; and if he could only recover this
possession for England—for, as you will find, this lake really
belongs to this country and not to Mexico or to Spain or to
the Jesuits—he would make himself that great, popular hero
he is ever striving to become. How? you ask. In the most
simple fashion. He would merely use all those millions that
are to be recovered from its depths as baits for the electors,
baits for payers of income-tax, men who drink spirits,
enthusiasts about old-age pensions, better houses for the
poor. Indeed, there is no end to the crazy ambition of this
pinchbeck Napoleon. He lives simply to become the idol of
the mob in such a way as England’s history with all her
Gladstones, her Beaconsfields, and other political leaders of
real note, has never known—never. Even the popularity of
the throne is not safe with so terrible a pride as his! He
cares nothing for any personage or any institution. His one
colossal lust is to lift himself so high that no man shall be
his equal, but that his word shall travel through the Empire
with a power which Bismarck never aimed at and even the
German Emperor has never felt competent to aspire to.

“I know the man like nobody else does in the House. Once
we were friends—before appeared the inevitable woman. I
was his one confidant. We occupied the same house; we sat
side by side, night after night, over the dinner-table,
building the same castles in the air; but, as we laid our
plans, and he waxed strong, the power to will and to
achieve in this muddy, political life of England came also to
me. Hence, while we quarrelled and hated like only one-
time bosom companions can, we have ever carried on a
terrific underground fight which has been all the more
deadly because it was hidden. Few expected it; and none of
the fools around me ever realised that a humble,
insignificant member like myself was hugging the idea of
the eventual overthrow of this wonderful strong man, who
had risen up, phoenix-like, from the ashes of a
dismembered and distrusted party in the State and had
brought back to Parliament the misty legend of a leader
who directed the attack by the sheer magic of his own
inherent will.

“But there!” added Mr Cooper-Nassington, suddenly


changing his tone as, away in the distance, he caught the
sound of rapidly approaching footsteps. “I am sure I don’t
know why I ramble on like this—to you. After all, those
manuscripts are the real object of our expedition, aren’t
they? and in regard to them I suppose we have done the
best that could be done in such a bewildering set of
circumstances. You had better return now to the man who
sent you and report to him all that has transpired since you
fetched me out of the House. He will understand,
particularly if you add two words to your narrative.”

“Yes,” said I eagerly; “and what must those be?”


”‘In reparation,’” he returned, ”‘in reparation.’” And,
signalling to a belated hansom, he held out his hand to me.

“Good-night, Mr Glynn,” he said; “I have trusted you to-


night more than anybody else in my life. I can’t tell you
why, but I have, and I am sure you will not make use of
anything I have said to my disadvantage. Doubtless, we
shall meet again over this strange, wild quest. If we do—
nay, whatever happens—remember I am your friend; but
for your actual employer I repeat I have only one message,
‘in reparation!’” And, squeezing my hand, he sprang into the
cab, crying to the driver: “Ashley Gardens.” The next instant
the cab had gone and I had started to find my way home on
foot.

Unfortunately, that was not destined to be the last of my


adventures that night, although I was tired and worn by the
stirring scenes I had passed through. I don’t think Mr
Cooper-Nassington had left me a minute before I was
conscious of that ugly sensation of being followed. At first I
tried to believe it was a mere phantom of my imagination—
that my nerves had got a trifle upset by the things which
the hunchback had shown to us in the way of tricks that
had been played upon him since he had obtained those
manuscripts.

Thus I didn’t attempt to look behind me, but went on my


way whistling merrily, making the pavements re-echo with
my noisy steps, for by that time the streets were practically
empty. All the same, I couldn’t rid myself of my suspicion
that I was being shadowed, and, finally, feeling that the
chase was getting intolerable, I decided on a rather curious
ruse. I had reached Westminster Bridge, and, walk to near
the centre, suddenly stopped and turned my face towards
the swirling waters that were eddying past the buttresses
beneath.
Next instant I staggered back in the fickle light of the lamp,
and, throwing my coat off my shoulders, cried in a muffled,
stifled kind of voice: “Ah! I can bear it no longer. I must do
it. Good-bye, good-bye.” And with a frantic bound I leaped
on to the parapet by the aid of a lamp-post and threw my
arms upward with a wild, convulsive movement, as though
the next second must be my last, and that I had but to take
one downward glance to hurl myself into the turgid torrent
beneath.

Just as I expected, my pursuer rushed pell-mell into the


trap that I had baited for him. No sooner did he catch a
glimpse of what he thought were my preparations for a
sudden and effective suicide than he instantly abandoned all
pretence of concealing his presence, darted out of the
shadows in which he had been lurking, and raced as swiftly
as a greyhound towards me and caught me by the sleeve
and dragged me backward.

“You fool,” he cried, “what are you up to now?” And in a


flash I recognised who it was—Detective-Inspector Naylor.

With a quick spring I reached the pavement again and


turned a face full of merriment towards the officer.

“Ah,” said I, picking up my coat, “so it was you who was


stalking me, was it? I thought my little trick would fetch you
much more rapidly and effectively than if I had turned
round and tried to pick you up. Now, what’s your game
dogging my footsteps, eh? You don’t think I’m a young
monk who has got spoiled in the making, do you? No;
you’ve some deeper, deadlier design than that, so you
might as well own up at once.”

“I can’t,” he returned, and his face, now he realised how I


had duped him, was a study in rage and mortification. “I—I
am out on business just as much as you are. You play your
hand, I’ll play mine. Only take care what you are up to—
that’s all. When we at Scotland Yard take up a case we
usually make some inquiries into the good faith and past
history of our clients. It’s a pity you don’t do the same.
Good-night.” And with a nod full of meaning he strolled off
towards the embankment, leaving me to digest his
enigmatic remark in silence and alone.

With a good-humoured laugh I took my way homeward and


tried to shake off the effects of his ominous words, which, I
own, caused me a certain amount of disquietude, for, after
all, I hadn’t a ghost of an idea then as to the real identity or
object of Don José Casteno. For a time, I own, I felt rather
fearful. But first one thing and then another engaged my
attention. For instance, I had to find out whether I was still
being followed. I decided I was not. I had also to dodge the
human night-bird of London intent on rows or alms. Finally,
by the time I had reached Trafalgar Square the ill effects of
the detective’s warning had quite disappeared. All I thought
of was a good night’s rest, to be followed by another ride on
my motor car to Hampstead, and another entrance to that
mysterious home of the Order of St. Bruno.

When, however, I reached the street in which my offices


were situate I was surprised to see the thoroughfare
presented anything but its usual drab and sombre
appearance. Something extraordinary was certainly in
progress therein. Instead of the place being deserted and
silent like the neighbouring streets, no fewer than three
carriages with flashing lamps and horses in glittering
harness were drawn up by one side of the curb, and near a
door stood quite a group of footmen, and loafers and
policemen drawn thither by the unusual assemblage.
As I got nearer I was even more surprised to find that this
strange gathering was centred round the door of my own
offices, which I was stupefied to see were brilliantly lit up.
“What on earth can have happened?” I gasped, and,
quickening my steps, I half ran towards the tiny crowd
gathered round the door, which seemed somehow to be
expecting me, and gave way instinctively at my approach.

Another moment and I had thrust open my office door. The


place was half filled by tobacco smoke, but through the mist
I was astounded to see three persons had calmly seated
themselves in my room to await my return—Lord
Fotheringay, Colonel Napier, and a stranger who, as he
turned his determined but forbidding looking features upon
me, I recognised instantly as Lord Cyril Cuthbertson, His
Majesty’s Secretary of State for Foreign Affairs.

“You must excuse us, Glynn,” Fotheringay began almost at


once. “I own I had no right to come here at all at this hour
and open your office. Most of all, I oughtn’t to have put on
your hearth two friends without your consent. Only, as
perhaps you guessed from the scene at the auction, we live
in rather stirring times just now, and we had no margin left
in which we could observe the ordinary courtesies. With
Colonel Napier you are, of course, well acquainted. Let me
introduce to you another distinguished man.” And he made
a movement in the direction of Lord Cyril Cuthbertson, who
rose and bowed.

“Pray be seated,” I hastened to exclaim as I took the chair


at my desk and faced the trio. “I mustn’t say, of course, I
expected this honour, because, after the way Fotheringay
sprang at me in the auction market, I certainly got the
impression he had no particular friendliness for me left—but
—”
“But that is precisely what we have come about,” interposed
the earl eagerly. “Those three old manuscripts which we
made so terrific a fight over—”

My lips closed, and a new look of resolution came into my


face.

“I see,” I replied. “Then, as it is a matter of business, I beg


you tell me what you desire in a plain, business-like
fashion.”

There was an awkward pause; and then Lord Cyril began: “I


understand, Mr Glynn,” he said in his most seductive tones,
“from no less an authority than the earl here, that you have
been retained to get possession of three historical
documents that were found among the effects of a certain
dead refugee priest who called himself Alphonse
Calasanctius. Now, are you aware to what those deeds
relate?”

I nodded, and the two men exchanged a quick look of


intelligence. “That being so,” proceeded Lord Cuthbertson,
“you will doubtless realise how important it is that His
Majesty’s Government, and not an enemy of this country,
should obtain possession of them.”

“Quite,” I returned, determining to meet the statesman’s


strategy with diplomacy as far-reaching as his own.

“And may I take it that you are prepared, as far as lies in


your power, to assist His Majesty’s Government in this
direction?”

“That is hardly necessary,” I said, with a smile. “I have not


got the documents at all. They are in the hands of a man
with whom I am but little acquainted—Mr Zouche. Wouldn’t
it be better if pressure were placed on him?”
“I can hardly agree in that,” said the Foreign Secretary
softly, and I saw I had countered but not defeated him. “In
the first place, Mr Zouche is not an English subject, like
yourself. He is Spanish, with all the absurd notions of the
average Spaniard as to the future glories and magnificence
of Spain. In the second place, he and Lord Fotheringay have
had this very point over between them, and the hunchback
has absolutely refused to assist us or the earl, who really
put him on the track of the documents, and who is now
trying, in vain, unfortunately, to frighten him out of them.”

“In other words,” I remarked sternly, “Lord Fotheringay first


of all threw in his lot with the hunchback, who went off with
the plunder, and won’t divide it. Thereupon he bethought
himself of his patriotism, and has said to you: ‘Here is a
matter of the honour and fair fame and fortune of England.
Come, let us sink all our personal greed and differences and
recover those deeds in the name and for the sake of our
common brotherhood of kin and blood.’ My lord, it won’t
answer with me. When I wanted help Fotheringay would not
raise a finger for me, but rather studied how he could throw
me back. Now he’s in trouble, let him get out of it; but let
him be a man over it, and don’t let him bleat about the
needs of England when he really means his own greed.”

“There’s a good deal in what you say,” remarked Lord


Cuthbertson, “but not everything. Bear with me a minute,
and I will explain. I have no doubt you are under the
impression that when Fotheringay went to Mexico he went
simply because he’d got a lot of spare cash, and wanted a
change, and to bag some big game. As a matter of fact, he
had no thought of the sort. He went as a special and a
private spy of the Foreign Office; and his business was,
under the harmless guise of an enthusiastic sportsman, to
investigate certain rumours we had heard as to the
discovery of these Jesuit plans of the sacred Lake of
Treasure which really belongs to England. Well, he did so,
and so cleverly did he manage that he penetrated the very
monastery in which they were hidden, and he got at the
very prior of the Order—a member of which had held them
in his possession. A certain bargain was struck between the
prior and himself, but before the Foreign Office could send
the big sum of money required to ratify it this Father
Alphonse Calasanctius ran away with the documents to
England, but was, we have reason to believe, poisoned on
his arrival by some compatriot or relative who knew nothing
of the value of the manuscripts, and thought only of the
forced sale of the goods which you and the earl attended.
Therefore I beg you don’t judge your old companion unfairly
and harshly. We all of us do many things for England in our
public capacity that we should not dare, or even wish, to do
for ourselves in our own private business. His sole blunder
was to get Zouche to help him, because Zouche is really a
villain who would dare any crime or fraud to help his
country, Spain. So it, of course, has happened as might
have been expected. Zouche has repudiated the earl, and
unless you can give us a hand England is going to lose this
sacred lake and its millions and Zouche.”

“He may not necessarily triumph,” I answered.

“There are probably other people hot on the track of those


manuscripts. To-day there have been one or two attempts
to make Zouche disgorge from a source which is truly bold
and daring and resourceful; I’ll assume, after what you say,
it is the earl. Well, let the earl continue his pressure. He
may frighten him out of them, but I doubt it—I doubt it very
much. Then there is my employer.”

“You must give that man up, Hugh,” cut in Colonel Napier,
who had not hitherto spoken. “He’s a scoundrel of the first
water. I know all about him. He escaped from that Mexican
monastery at the same time as Father Alphonse
Calasanctius, but not before he killed Earl Fotheringay’s
companion, young Sutton.”

“That is false,” suddenly interrupted a strange voice, “and


the police of London and Mexico know it, for the deed was
done by Calasanctius himself, and not by the novice at all.”
And to everybody’s astonishment the doors of my big
cupboard were flung open, and there stepped therefrom no
less a personage than Don José Casteno himself.
Chapter Eight.
Some Grave Suspicions.

For a moment all was confusion. Colonel Napier sprang to


his feet with an angry gesture, and even Lord Cyril
Cuthbertson rose and crossed over to the place where
Fotheringay was sitting near the fire, and consulted him in
low and anxious tones.

Curiously enough, Casteno appeared to be the least


perturbed of any of us, although he had made such a
dramatic entry. Somehow he seemed to take his position in
that conference as a matter of right, and when he saw that
none of the others were prepared to talk to him on any
terms, but were determined to treat him as a bold,
impertinent interloper, he swung round from them and
stepped up to my desk, where I sat idly playing with a pen.

“It is not true that I am the wretch whom Colonel Napier


has spoken of,” he said to me very simply, looking me
straight in the eyes. “It is not true that I am an enemy of
England, such as Lord Cuthbertson has suggested. It is not
true that I am engaged in any dishonourable or unpatriotic
enterprise; nor was it begun, as they pretend, by my flight
from a monastery in Mexico coincident with the
disappearance of Father Calasanctius; nor did it include in
its train the killing of that exceedingly foolish and indiscreet
personage, Sutton. On the contrary, I assert here that all
and each of those allegations are false; and what is perhaps
the more intolerable is the fact that Lord Cyril knows it, has
on his file at the Foreign Office a full report of the affair,
coupled with a diplomatic request that the man should be
found and returned to his friends.”
And he turned and faced the Secretary for Foreign Affairs
with a striking look of defiance; but that nobleman would
not take up his challenge. He merely drew a little closer to
the earl, who was now standing listening to him with an
expression of the most grave concern, and the shot went
wide.

In no sense disconcerted, however, Don José confronted me


again.

“You see,” he said significantly, “Lord Cuthbertson’s striking


change of manner when I am here to face him out. I repeat
to you that he dare not deny what I have just told you,
although it suited his purpose well enough to blacken my
name when I was not here to speak up for myself. The point
for you now to consider,” he went on in a lower tone, “is, as
a man of honour, not whether you can take up the cause of
Lord Cuthbertson but if you can throw me over on such
flimsy, unsubstantial talk as this has been.”

“If he doesn’t, Doris shall never speak to him again,” cut in


Colonel Napier, who was an old Anglo-Indian, and nothing if
not a most persistent fire-eater.

Don José turned as swiftly as though he had been stung by


a snake. “Colonel, that is not worthy of you,” he cried. “I
beg you withdraw it for your own sake, for I warn you most
solemnly that before a day has gone you will regret it.”

“And I, as an Englishman, jealous of my country’s success,


refuse,” thundered the old soldier. “Let it be enough that I
have spoken. Mr Glynn can make his own choice.” And
throwing back his shoulders he stalked impressively out of
the room.

Almost unobserved, too, the Secretary for Foreign Affairs


and Earl Fotheringay had also manoeuvred their steps
towards the doorway; and now, when Casteno tried to
speak with them, they took advantage of a pause created
by the sudden rattle of the colonel’s carriage as he drove
towards the Strand to slip out of the room. A minute later
there arose the sound of a loud commotion, as of doors
banged and of horses urged to a gallop, and both of their
broughams followed hard in the old soldier’s wake.

“You see,” said Don José to me, with a little bitterness,


“they are not men big enough to face me out over this
matter. They prefer to fling their poisoned darts at me and
to leave them to work their own mischief, whilst they scuttle
off like naughty children who have thrown some stones
through a window and are quite content with the sight of
the damage they have done, without a thought of the
anguish of the householder. Well, well! all this is the trouble
which you will no doubt remember that I, at least, expected
and warned you against when I asked you to join forces
with me. I must not now rail against my own fate, but I do
appeal to you—give me a fair chance, do not desert me.”

For an instant I wavered. This quest now had assumed truly


gigantic dimensions. Even Cooper-Nassington seemed only
a dim, far-off figure against the overwhelming personality of
Cuthbertson. More than that, I knew if I clung to Casteno I
should have one of the most stern fights with Colonel
Napier, who would stop at nothing to keep Doris apart from
me.

None the less, I had my own notions of honour likewise,


and it did not concern me much that they differed from Earl
Fotheringay’s or Lord Cyril Cuthbertson’s. After all, had I not
taken my fee from Don José? Had he not paid me all that I
asked? Had I not passed him the sacred pledge of my word?
And so, at last, I gave my decision.
“I have seen nothing in your life, your behaviour, or your
conduct,” I cried, “to warrant me in throwing you over in the
way those men have suggested. Until I find some good
reason to believe that your intentions are dishonourable,
that your career has been criminal, that your desires are
hostile to England, I cannot desert you.”

“Well spoken,” replied Don José earnestly. “Your


determination does you credit. Believe me, you shall find no
cause to make you ashamed that you ever allied yourself
with me. On the contrary, as you go deeper into this
business you will realise that you have done well to stick to
me, however baffling and perplexing may seem some of the
adventures I may have to ask you to undertake. And that
reminds me of the real business we have in hand to-night!
How did you get on at the House of Commons with Cooper-
Nassington?”

“Very much better than I could have dared to expect,” I


replied with frankness, and returning him his sealed packet
addressed to Cuthbertson. In a few graphic sentences I
described to him how I had gone to the house of the
hunchback with the Member of Parliament, and the
extraordinary adventures we had undergone there. Instead,
however, of being pleased with the result of the quest, I
could see that the Spaniard was greatly disturbed at
something that had happened on that occasion. At first he
would not tell why we ought not to congratulate ourselves
that Zouche had promised to decipher those manuscripts
and communicate their contents within a fortnight to Mr
Cooper-Nassington. He tried to put me off with
commonplace expressions like “Time will prove,” “Never
count your chickens,” and “Trust no man further than you
can throw him;” but when he realised that I was not going
to be denied he admitted that my news about the attempts
on the hunchback’s life was much more serious than
anybody had any idea of, because they might terrify Zouche
and make him do things he would not otherwise dream of.

“But we two are men with brains, hands, resolution,” I


interjected. “Why need we stand by and let other people
like Fotheringay come in and benefit by our labours? Let us
mount guard over Zouche until he has got through his task
of deciphering the documents.”

“That’s exactly what I was thinking,” returned Casteno, “but


it is not so easy to do as it seems. For one thing, Zouche
would not let us act in the capacity of his guardians if he
knew we had any aspirations at all for that office. Another
thing—where can we hide ourselves? And then,” he added
after a significant pause, “I wanted you to be busy on
another mission. I had a particular reason for wishing that
you should go down to Southampton to-morrow afternoon,
when the royal mail steamer Atrato is expected. A lady
whom I want you to meet is coming by that boat. As a
matter of fact, she is bringing certain valuable documents
for me and for the Order of St. Bruno, and she will need all
the protection you can give her between the Solent and the
Thames if she isn’t kidnapped by some friends of
Fotheringay, who, when he was in Mexico, learnt all about
her treasures.”

“In that case you must watch the hunchback,” I said


decisively, “whilst I run down from Waterloo to
Southampton. The whole business won’t take me more than
ten hours from London to dock and dock to London.”

“But how on earth shall I watch Zouche? How shall I gain


admission to his shop without his knowledge? And where
can I hide myself without any undue risk of being found
out?”
“A house like his, full of the most extraordinary curiosities,
is the best hiding-place one could have,” I replied. “The only
trouble is to get inside it, but I am sure if I go with you and
help you, and we watch our chance, say whilst his man is
taking down the shutters, we can both slip in and run up to
the first-floor showroom, which is over the parlour. Once
there I will help you to conceal yourself, and also open up
for you a peep-hole in the ceiling of the room where the
hunchback does his research work, without the slightest
fear you will be pounced on. Why, old curiosity shops in
London are never disturbed or dusted! Dust is part of the
stock-in-trade. Most dealers seem perfectly satisfied if they
sell one thing out of each room per week—and often that
one thing may be merely a miniature or a coin!”

“All right, I’ll leave the arrangements with you,” answered


the Spaniard, with a laugh. “For the present, however, the
most important thing for you at least seems to be sleep. I
propose, therefore, that before we make another move of
any kind you turn in and get a few hours’ sleep whilst I
mount guard.”

“Yes, I’m tired,” I admitted, with a half-smothered yawn;


“and, after all, we can do nothing at the hunchback’s until
about nine o’clock, so I think I will do as you suggest.” And
placing some more coal on the fire I wished him good-night
and made my way to my adjacent bedroom, where,
throwing myself on the sofa, I closed my eyes and
endeavoured to push myself off into a soft, dreamless
slumber.

Now it is a curious thing that, whereas in the ordinary way I


am about one of the heaviest and solidest sleepers you
could meet in a day’s journey, when danger threatens me or
my interests I seem to have some special intuition which
keeps me awake and sensitive to the slightest omen or
sound. I can’t explain it. There it is. Ever since I was a boy I
have possessed it, and not once has it failed to warn me
when I ought to be up and about.

And the odd part of it was that it made itself most painfully
evident this night on which Don José Casteno proffered to
look after me. In vain I heard his own soft and regular
breathing as I crept to the half-open door noiselessly and
listened to his movements. In vain I drew the clothes right
over my head and conjured up sheep jumping over a stile;
pigs elbowing each other through a half-open gate; dogs
passing in endless procession, each with a most plaintive
look of entreaty that I should wear my brain out counting
them for some unseen but remorseless master-calculator—I
could not go to sleep. Even the Brahmin magic word “O—
om,” which I repeated slowly twice a minute, expelling the
air each time most completely from my lungs, failed to
hypnotise me. And then all at once I heard something—a
slow grating sound that seemed to suggest treachery and
mischief.

With all my senses painfully alert I wriggled off my bed and


went on hands and knees, dressed only in my trousers and
shirt, to the door of my outer office. To my surprise I found
Casteno, crouching on his knees also, in front of the fire,
which threw a powerful rosy glare on his clean-shaven
features. He had pulled a long evil-looking dagger out of a
belt hidden near his waist and was sharpening its edge on
the hearthstone!

He meant mischief. To whom?

Suddenly, before I had time to think, he rose, and taking up


his clerical-looking hat he stepped noiselessly across the
office and hastened off down the street, a look of terrible
resolution on his face.
Whither was he bound?

Had he heard something that had put him on his guard as


he sat crouched over the fire in my arm-chair? Had he seen
something or somebody that meant mischief to me? Or had
he suddenly resolved to take advantage of those early
morning hours to avenge himself on some enemy who lived
near at hand? That was where I felt myself as up against a
solid wall; it was so hard to divine what was at the back of a
foreign stranger with a past that might have been crowded
with duel and vendetta and adventure that had given birth
to a dozen most deadly hatreds and lusts for revenge.

Half mechanically I went to the doorway and peered


through the early morning haze up and down Stanton
Street. I could see no one—nothing suspicious—nothing
suggestive at all. I was just about to return to my bedroom
when I was startled by something playing about my feet. In
a flash I looked down, and to my astonishment found
Colonel Napier’s clumber spaniel gazing at me with the
most appealing eyes.

“Hulloa, Fate!” I said, giving him his customary but oddly


suggestive name. “Where have you sprung from? What are
you doing here? Did you run after your master’s carriage
when the colonel came with Lord Cuthbertson and get
locked in some cupboard in the office here, or did you fall
asleep on a pile of papers?”

The dog looked up, wagging his tail. Then all at once he
gave a sharp bark, and swinging round he tore through the
open door down the street as hard as he could pelt. For an
instant I was quite astonished. As a rule the dog would stop
and fuss with me and play several tricks. Now his manner
was so curious that I decided at last he must have expected
I should follow him.
“But that must be a long time yet,” I told myself, with a
sigh. “I can never see Doris now until I have cleared up this
mystery of the manuscripts for Don José.” And, shrugging
my shoulders, I made my way back to the bedroom where,
feeling sleep was out of the question, and that I must try in
real earnest to solve the mystery of the expedition of the
Spaniard, I had a tub, and made a hurried toilet, and then
set to work to get myself some breakfast.

In about half-an-hour’s time, however, Don José returned,


and when he caught sight of me up and dressed he gave
such a start of terror I thought that he would drop on the
floor in a fit.

“Well,” I said lightly. “You didn’t expect to see me about, did


you? Fact was, I couldn’t sleep, so I got up to make myself
a cup of tea. Where have you been to at this ungodly hour?”

“To a friend’s,” he stammered. “A friend’s in Whitehall Court.


Just a call—a friendly call. A man I know in Whitehall
Court.”

“In Whitehall Court,” I repeated, bending over some toast I


was buttering. “Why, that’s where Colonel Napier lives! Did
you happen to see a clumber spaniel heading in that
direction? He was here a few minutes ago, but suddenly he
bolted for his home in great distress, and I thought that—”

But I never completed the sentence.

All at once I was startled by the sound of a loud fall.

I looked round.

To my surprise I found that Don José Casteno had dropped


to the floor in a dead faint.
Chapter Nine.
The Hunchback Tries a New Ruse.

Fortunately, or unfortunately, as the sequel must determine,


Don José Casteno’s attack of faintness was not of long
duration. Almost, indeed, as I snatched up a flask of brandy
from my travelling case and darted across the office to his
assistance, he gave a long deep sigh, his eyelids fluttered,
and the next moment he sat up, gazing in a bewildered
fashion round the room. He took, however, a deep draught
of the spirit when I pressed it upon him, but when I
ventured to inquire what it was that had caused him to
collapse after his walk through the streets from the
Embankment to the Strand his eyes grew large and
troubled, although he made a tremendous effort to hide his
agitation.

“Really, nothing happened to me,” he said in a quick,


disjointed fashion. “I visited the man at Whitehall I wished
to see, and then, fearing I had done wrong in leaving you
unprotected as you slept trusting to my presence, I ran as
hard as I could back to your office. The fact is, I must have
got rather out of condition of late, and the exertion took
more out of me than I intended. You must forgive me this
time, and I’ll be more careful in future.”

“Then you didn’t see anything of Colonel Napier’s clumber


spaniel?” I queried, and in spite of myself there arose a
certain accent of suspicion in my tones.

“No, I didn’t,” he replied, but he kept his gaze steadily


averted from mine. “No doubt I ran too fast to notice
anything. Besides, I always keep my head down.” And,
pretending to yawn, he rose unsteadily to his feet and took
a seat near the table, whereon I had laid breakfast for us
both.

Of course, I should like to have asked him about the knife


which I had watched him sharpen with so much diabolical
care, but I realised that for some secret reason this
innocent-looking Spaniard was not really telling me the
truth about his early morning mission; and, not wanting to
be filled up with any more fables, I decided to hold my
tongue about the matter, for a time at all events. The
incident, however, had put me thoroughly on my guard,
and, without letting him become conscious of what was,
after all, a rather subtle change of front, I kept a much
closer watch than usual on him right through the meal,
when we chatted a lot of commonplaces.

All the same, he seemed to feel that we had little time to


waste when breakfast was finished and we had started our
cigarettes. As the seconds slipped on, and I showed no
unusual haste to be off, his manner grew jerky and
nervous, and finally he gave the signal to rise with a quick
apology to me.

“Really, we must be off,” he said. “I feel quite anxious about


what is happening at the hunchback’s. Do let us get into
some secure place of concealment before Lord Fotheringay
or his envoy appears again on the scene.”

With a great affectation of laziness I rose and followed him


down Stanton Street; and this time I put a double safety-
lock on my office, to save me from any more surprise visits
from men like Lord Cyril Cuthbertson. Now, as it happens,
the quickest route from Stanton Street to the Strand is by
way of a long, dark, narrow passage, and although Casteno
hurried past I made him retrace his steps for a few yards
and walk with me through this. At first I imagined I had
done this from purely British obstinacy and habit, but all at
once I became conscious that some deeper influence and
habit must have been at work, for on rounding a bend I was
startled to come across a group of early printers’ boys and
charwomen gathered excitedly around some object that lay
on the ground. This tiny crowd instinctively parted at our
approach, and as we passed into their midst I was horrified
to see Colonel Napier’s clumber spaniel Fate stretched on
the path, with a great gaping cut over its heart!

“Some brute has stabbed it,” said one of the boys, who had
been kneeling beside it endeavouring to stop the flow of
blood with his dirty handkerchief. “I did my best for him,
but he was too far gone. He’s almost dead.” But suddenly
the dog seemed to rouse himself—to lift his head—then,
catching sight of Casteno, he gave a low growl and made a
movement as if he would snap at his legs.

The Spaniard jumped back nimbly, and one of the women


exclaimed: “Why, mister, he seems to know you.”

“He doesn’t. I have never seen him before,” cried Casteno.


And just then death convulsions seized the poor brute, and
as the crowd watched the dog die the incident passed
rapidly out of mind. I did not, however, forget it totally, nor
the fact that Fate was one in a thousand for sagacity and
faithfulness. But what, perhaps, impressed me the most
was the shape and size of the wound in the dog’s side. I
could have sworn that it had been made by the dagger I
had seen Don José sharpen in the glare of my office fire!

Unfortunately, up to that point I had nothing definite to go


upon except the most wild and improbable suspicion. After
all, why should the Spaniard kill Colonel Napier’s dog?
Nothing was to be gained by a piece of petty revenge such
as that. As a consequence, I did not worry myself about the
incident further, but contented myself by giving the boy who
had spoken to me first a shilling to wheel the dead dog to
Whitehall Court, and then Casteno and I hastened along
Parliament Street and soon appeared outside the closed
curio shop.

To all appearances, then, nothing unusual had happened to


Peter Zouche or to his premises. The street in which the old
curiosity store stood was just as silent and deserted as it
had been the previous night when Mr Cooper-Nassington
and I drove up and had that memorable interview with the
hunchback about the contents of the manuscripts. Nobody
seemed astir, no detective appeared on the watch.

Like shadows we crossed the road, inspected the shutters,


and gently but noiselessly tried the handle of the door. We
soon saw that there was no chance of gaining admission by
these methods, but a moment later I caught sight of a long
iron pipe that ran from the roof to the ground by the side of
the door.

“Can you climb?” I whispered to the Spaniard, recalling, all


at once, the favourite method of the portico thief.

He nodded. “I served as a sailor once,” he returned.

“Then follow me,” I said, and seizing this pipe I travelled up


by hands and knees until I reached the level of the first-
floor window-sill. Then out I whipped my knife, and, forcing
back the catch, I raised the sash, with the result that in less
than twenty seconds after I had hit on this ruse the window
had been closed again, and both of us stood inside the
hunchback’s stronghold in perfect freedom and safety.

“This is better than waiting until the assistant comes to


open the shop,” I said. “After all, he might have given us
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like