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

Full Download MATLAB Curve Fitting Toolbox User S Guide The Mathworks PDF

User

Uploaded by

dobijaaeris
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
29 views

Full Download MATLAB Curve Fitting Toolbox User S Guide The Mathworks PDF

User

Uploaded by

dobijaaeris
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Download the full version of the textbook now at textbookfull.

com

MATLAB Curve Fitting Toolbox User s Guide The


Mathworks

https://textbookfull.com/product/matlab-curve-
fitting-toolbox-user-s-guide-the-mathworks/

Explore and download more textbook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

MATLAB Econometrics Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-econometrics-toolbox-user-s-
guide-the-mathworks/

textbookfull.com

MATLAB Bioinformatics Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-bioinformatics-toolbox-user-s-
guide-the-mathworks/

textbookfull.com

MATLAB Mapping Toolbox User s Guide The Mathworks

https://textbookfull.com/product/matlab-mapping-toolbox-user-s-guide-
the-mathworks/

textbookfull.com

International Review of Cell and Molecular Biology 1st


Edition Kwang W. Jeon (Eds.)

https://textbookfull.com/product/international-review-of-cell-and-
molecular-biology-1st-edition-kwang-w-jeon-eds/

textbookfull.com
Building Machine Learning Powered Applications Going from
Idea to Product 1st Edition Emmanuel Ameisen

https://textbookfull.com/product/building-machine-learning-powered-
applications-going-from-idea-to-product-1st-edition-emmanuel-ameisen/

textbookfull.com

Modelling Nature An Opinionated Introduction to Scientific


Representation Roman Frigg

https://textbookfull.com/product/modelling-nature-an-opinionated-
introduction-to-scientific-representation-roman-frigg/

textbookfull.com

The History of Gangster Rap From Schoolly D to Kendrick


Lamar the Rise of a Great American Art Form Soren Baker

https://textbookfull.com/product/the-history-of-gangster-rap-from-
schoolly-d-to-kendrick-lamar-the-rise-of-a-great-american-art-form-
soren-baker/
textbookfull.com

How to Stay Human in a F cked Up World Mindfulness


Practices for Real Life Tim Desmond

https://textbookfull.com/product/how-to-stay-human-in-a-f-cked-up-
world-mindfulness-practices-for-real-life-tim-desmond/

textbookfull.com

The Daily Happiness Multiplier 52 Secret Habits to


Discover Your True Hidden Potential in Life and Business
Bimal Shah
https://textbookfull.com/product/the-daily-happiness-
multiplier-52-secret-habits-to-discover-your-true-hidden-potential-in-
life-and-business-bimal-shah/
textbookfull.com
R For College Mathematics and Statistics 1st Edition
Thomas Pfaff

https://textbookfull.com/product/r-for-college-mathematics-and-
statistics-1st-edition-thomas-pfaff/

textbookfull.com
Curve Fitting Toolbox™
User's Guide

R2020a
How to Contact MathWorks

Latest news: www.mathworks.com

Sales and services: www.mathworks.com/sales_and_services

User community: www.mathworks.com/matlabcentral

Technical support: www.mathworks.com/support/contact_us

Phone: 508-647-7000

The MathWorks, Inc.


1 Apple Hill Drive
Natick, MA 01760-2098
Curve Fitting Toolbox™ User's Guide
© COPYRIGHT 2001–2020 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied
only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form
without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through
the federal government of the United States. By accepting delivery of the Program or Documentation, the government
hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer
software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014.
Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain
to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and
Documentation by the federal government (or other entity acquiring for or through the federal government) and shall
supersede any conflicting contractual terms or conditions. If this License fails to meet the government's needs or is
inconsistent in any respect with federal procurement law, the government agrees to return the Program and
Documentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be
trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for
more information.
Revision History
July 2001 First printing New for Version 1 (Release 12.1)
July 2002 Second printing Revised for Version 1.1 (Release 13)
June 2004 Online only Revised for Version 1.1.1 (Release 14)
October 2004 Online only Revised for Version 1.1.2 (Release 14SP1)
March 2005 Online only Revised for Version 1.1.3 (Release 14SP2)
June 2005 Third printing Minor revision
September 2005 Online only Revised for Version 1.1.4 (Release 14SP3)
March 2006 Online only Revised for Version 1.1.5 (Release 2006a)
September 2006 Online only Revised for Version 1.1.6 (Release 2006b)
November 2006 Fourth printing Minor revision
March 2007 Online only Revised for Version 1.1.7 (Release 2007a)
September 2007 Online only Revised for Version 1.2 (Release 2007b)
March 2008 Online only Revised for Version 1.2.1 (Release 2008a)
October 2008 Online only Revised for Version 1.2.2 (Release 2008b)
March 2009 Online only Revised for Version 2.0 (Release 2009a)
September 2009 Online only Revised for Version 2.1 (Release 2009b)
March 2010 Online only Revised for Version 2.2 (Release 2010a)
September 2010 Online only Revised for Version 3.0 (Release 2010b)
April 2011 Online only Revised for Version 3.1 (Release 2011a)
September 2011 Online only Revised for Version 3.2 (Release 2011b)
March 2012 Online only Revised for Version 3.2.1 (Release 2012a)
September 2012 Online only Revised for Version 3.3 (Release 2012b)
March 2013 Online only Revised for Version 3.3.1 (Release 2013a)
September 2013 Online only Revised for Version 3.4 (Release 2013b)
March 2014 Online only Revised for Version 3.4.1 (Release 2014a)
October 2014 Online only Revised for Version 3.5 (Release 2014b)
March 2015 Online only Revised for Version 3.5.1 (Release 2015a)
September 2015 Online only Revised for Version 3.5.2 (Release 2015b)
March 2016 Online only Revised for Version 3.5.3 (Release 2016a)
September 2016 Online only Revised for Version 3.5.4 (Release 2016b)
March 2017 Online only Revised for Version 3.5.5 (Release 2017a)
September 2017 Online only Revised for Version 3.5.6 (Release 2017b)
March 2018 Online only Revised for Version 3.5.7 (Release 2018a)
September 2018 Online only Revised for Version 3.5.8 (Release 2018b)
March 2019 Online only Revised for Version 3.5.9 (Release 2019a)
September 2019 Online only Revised for Version 3.5.10 (Release 2019b)
March 2020 Online only Revised for Version 3.5.11 (Release 2020a)
Contents

Getting Started
1
Curve Fitting Toolbox Product Description . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2

Curve Fitting Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3

Curve Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4


Interactive Curve Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Programmatic Curve Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4

Surface Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6


Interactive Surface Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
Programmatic Surface Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6

Spline Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8


About Splines in Curve Fitting Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Interactive Spline Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Programmatic Spline Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8

Interactive Fitting
2
Interactive Curve and Surface Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Introducing the Curve Fitting App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Fit a Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Fit a Surface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Model Types for Curves and Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Selecting Data to Fit in Curve Fitting App . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Save and Reload Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6

Data Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8


Selecting Data to Fit in Curve Fitting App . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
Selecting Compatible Size Surface Data . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Troubleshooting Data Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10

Create Multiple Fits in Curve Fitting App . . . . . . . . . . . . . . . . . . . . . . . . . 2-11


Refining Your Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Creating Multiple Fits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Duplicating a Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Deleting a Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Displaying Multiple Fits Simultaneously . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Using the Statistics in the Table of Fits . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13

v
Generating MATLAB Code and Exporting Fits . . . . . . . . . . . . . . . . . . . . . 2-15
Interactive Code Generation and Programmatic Fitting . . . . . . . . . . . . . 2-15

Compare Fits in Curve Fitting App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16


Interactive Curve Fitting Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Loading Data and Creating Fits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Determining the Best Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Analyzing Your Best Fit in the Workspace . . . . . . . . . . . . . . . . . . . . . . . . 2-22
Saving Your Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24

Surface Fitting to Franke Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-26

Programmatic Curve and Surface Fitting


3
Curve and Surface Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Fitting a Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Fitting a Surface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Model Types and Fit Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Workflow for Command Line Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3

Curve and Surface Fitting Objects and Methods . . . . . . . . . . . . . . . . . . . . 3-6


Curve Fitting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
Curve Fitting Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Surface Fitting Objects and Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9

Linear and Nonlinear Regression


4
Parametric Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Parametric Fitting with Library Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Selecting a Model Type Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Selecting Model Type Programmatically . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Using Normalize or Center and Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Specifying Fit Options and Optimized Starting Points . . . . . . . . . . . . . . . . 4-5

List of Library Models for Curve and Surface Fitting . . . . . . . . . . . . . . . . 4-10


Use Library Models to Fit Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
Library Model Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
Model Names and Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11

Polynomial Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14


About Polynomial Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
Fit Polynomial Models Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
Fit Polynomials Using the Fit Function . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
Polynomial Model Fit Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25
Defining Polynomial Terms for Polynomial Surface Fits . . . . . . . . . . . . . . 4-26

vi Contents
Exponential Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28
About Exponential Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28
Fit Exponential Models Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28
Fit Exponential Models Using the fit Function . . . . . . . . . . . . . . . . . . . . . 4-30

Fourier Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34


About Fourier Series Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34
Fit Fourier Models Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34
Fit Fourier Models Using the fit Function . . . . . . . . . . . . . . . . . . . . . . . . 4-35

Gaussian Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42


About Gaussian Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42
Fit Gaussian Models Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42
Fit Gaussian Models Using the fit Function . . . . . . . . . . . . . . . . . . . . . . . 4-43

Power Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-45


About Power Series Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-45
Fit Power Series Models Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-45
Fit Power Series Models Using the fit Function . . . . . . . . . . . . . . . . . . . . 4-46

Rational Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48


About Rational Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48
Fit Rational Models Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48
Selecting a Rational Fit at the Command Line . . . . . . . . . . . . . . . . . . . . . 4-49
Example: Rational Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-49

Sum of Sines Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-54


About Sum of Sines Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-54
Fit Sum of Sine Models Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-54
Selecting a Sum of Sine Fit at the Command Line . . . . . . . . . . . . . . . . . . 4-55

Weibull Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-56


About Weibull Distribution Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-56
Fit Weibull Models Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-56
Selecting a Weibull Fit at the Command Line . . . . . . . . . . . . . . . . . . . . . 4-57

Least-Squares Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-59


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-59
Error Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-59
Linear Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-60
Weighted Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-62
Robust Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-63
Nonlinear Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-65
Robust Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-66

Custom Linear and Nonlinear Regression


5
Custom Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Custom Models vs. Library Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Selecting a Custom Equation Fit Interactively . . . . . . . . . . . . . . . . . . . . . . 5-2
Selecting a Custom Equation Fit at the Command Line . . . . . . . . . . . . . . . 5-4

vii
Custom Linear Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
About Custom Linear Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
Selecting a Linear Fitting Custom Fit Interactively . . . . . . . . . . . . . . . . . . 5-6
Selecting Linear Fitting at the Command Line . . . . . . . . . . . . . . . . . . . . . 5-7
Fit Custom Linear Legendre Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . 5-8

Custom Nonlinear Census Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16

Custom Nonlinear ENSO Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-19


Load Data and Fit Library and Custom Fourier Models . . . . . . . . . . . . . . 5-19
Use Fit Options to Constrain a Coefficient . . . . . . . . . . . . . . . . . . . . . . . 5-21
Create Second Custom Fit with Additional Terms and Constraints . . . . . 5-23
Create a Third Custom Fit with Additional Terms and Constraints . . . . . . 5-24

Gaussian Fitting with an Exponential Background . . . . . . . . . . . . . . . . . 5-27

Surface Fitting to Biopharmaceutical Data . . . . . . . . . . . . . . . . . . . . . . . . 5-30

Interpolation and Smoothing


6
Nonparametric Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2

Interpolation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3


About Interpolation Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3

Selecting an Interpolant Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5


Selecting an Interpolant Fit Interactively . . . . . . . . . . . . . . . . . . . . . . . . . 6-5
Fit Linear Interpolant Models Using the fit Function . . . . . . . . . . . . . . . . . 6-5

Smoothing Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8


About Smoothing Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
Selecting a Smoothing Spline Fit Interactively . . . . . . . . . . . . . . . . . . . . . 6-9
Fit Smoothing Spline Models Using the fit Function . . . . . . . . . . . . . . . . 6-10
Example: Nonparametric Fitting with Cubic and Smoothing Splines . . . . 6-11

Lowess Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15


About Lowess Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
Selecting a Lowess Fit Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
Fit Lowess Models Using the fit Function . . . . . . . . . . . . . . . . . . . . . . . . 6-16

Fit Smooth Surfaces To Investigate Fuel Efficiency . . . . . . . . . . . . . . . . . 6-18

Filtering and Smoothing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26


About Data Smoothing and Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
Moving Average Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26
Savitzky-Golay Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27
Local Regression Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28
Example: Smoothing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
Example: Smoothing Data Using Loess and Robust Loess . . . . . . . . . . . . 6-33

viii Contents
Fit Postprocessing
7
Explore and Customize Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Displaying Fit and Residual Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Viewing Surface Plots and Contour Plots . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
Using Zoom, Pan, Data Cursor, and Outlier Exclusion . . . . . . . . . . . . . . . . 7-4
Customizing the Fit Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5
Print to MATLAB Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6

Remove Outliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8


Remove Outliers Interactively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
Exclude Data Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
Remove Outliers Programmatically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9

Select Validation Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12

Generate Code and Export Fits to the Workspace . . . . . . . . . . . . . . . . . . 7-13


Generating Code from the Curve Fitting App . . . . . . . . . . . . . . . . . . . . . 7-13
Exporting a Fit to the Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14

Evaluate a Curve Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16

Evaluate a Surface Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25

Compare Fits Programmatically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32

Evaluating Goodness of Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-44


How to Evaluate Goodness of Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-44
Goodness-of-Fit Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-45

Residual Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-48


Plotting and Analysing Residuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-48
Example: Residual Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-49

Confidence and Prediction Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-52


About Confidence and Prediction Bounds . . . . . . . . . . . . . . . . . . . . . . . . 7-52
Confidence Bounds on Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-52
Prediction Bounds on Fits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-53
Compute Prediction Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-55

Differentiating and Integrating a Fit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-57

ix
Spline Fitting

About Splines
8
Introducing Spline Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
About Splines in Curve Fitting Toolbox . . . . . . . . . . . . . . . . . . . . . . . 8-2
Spline Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Interactive Spline Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Programmatic Spline Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3

Curve Fitting Toolbox Splines and MATLAB Splines . . . . . . . . . . . . . 8-4


Curve Fitting Toolbox Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
MATLAB Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
Expected Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
Vector Data Type Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
Spline Function Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . 8-6
Arguments for Curve Fitting Toolbox Spline Functions . . . . . . . . . . . 8-6
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7

Simple Spline Examples


9
Cubic Spline Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
Cubic Spline Interpolant of Smooth Data . . . . . . . . . . . . . . . . . . . . . 9-2
Periodic Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3
Other End Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
General Spline Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
Knot Choices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5
Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-6
Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7

Vector-Valued Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-9

Fitting Values at N-D Grid with Tensor-Product Splines . . . . . . . . . 9-11

Fitting Values at Scattered 2-D Sites with Thin-Plate Smoothing


Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-12

Postprocessing Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13

x Contents
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Types of Splines
10
Types of Splines: ppform and B-form . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Polynomials vs. Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
ppform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
B-form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Knot Multiplicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3

B-Splines and Smoothing Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4


B-Spline Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4
Variational Approach and Smoothing Splines . . . . . . . . . . . . . . . . . 10-4

Multivariate and Rational Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6


Multivariate Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
Rational Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7

The ppform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8


Introduction to ppform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8
Definition of ppform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8

Constructing and Working with ppform Splines . . . . . . . . . . . . . . . 10-10


Constructing a ppform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10
Working With ppform Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10
Example ppform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11

The B-form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13


Introduction to B-form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13
Definition of B-form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13
B-form and B-Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13
B-Spline Knot Multiplicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-14
Choice of Knots for B-form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15

Constructing and Working with B-form Splines . . . . . . . . . . . . . . . 10-17


Construction of B-form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
Working With B-form Splines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
Example: B-form Spline Approximation to a Circle . . . . . . . . . . . . 10-18

Multivariate Tensor Product Splines . . . . . . . . . . . . . . . . . . . . . . . . 10-21


Introduction to Multivariate Tensor Product Splines . . . . . . . . . . . 10-21
B-form of Tensor Product Splines . . . . . . . . . . . . . . . . . . . . . . . . . 10-21
Construction With Gridded Data . . . . . . . . . . . . . . . . . . . . . . . . . . 10-21
ppform of Tensor Product Splines . . . . . . . . . . . . . . . . . . . . . . . . . 10-22
Example: The Mobius Band . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-22

NURBS and Other Rational Splines . . . . . . . . . . . . . . . . . . . . . . . . . 10-23


Introduction to Rational Splines . . . . . . . . . . . . . . . . . . . . . . . . . . 10-23
rsform: rpform, rBform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-23

Constructing and Working with Rational Splines . . . . . . . . . . . . . . 10-25


Rational Spline Example: Circle . . . . . . . . . . . . . . . . . . . . . . . . . . 10-25
Rational Spline Example: Sphere . . . . . . . . . . . . . . . . . . . . . . . . . 10-26
Functions for Working With Rational Splines . . . . . . . . . . . . . . . . 10-26

xi
Constructing and Working with stform Splines . . . . . . . . . . . . . . . 10-28
Introduction to the stform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-28
Construction and Properties of the stform . . . . . . . . . . . . . . . . . . 10-28
Working with the stform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-29

Advanced Spline Examples


11
Least-Squares Approximation by Natural Cubic Splines . . . . . . . . . 11-2
Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
General Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
Need for a Basis Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
A Basis Map for “Natural” Cubic Splines . . . . . . . . . . . . . . . . . . . . . 11-3
The One-line Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
The Need for Proper Extrapolation . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
The Correct One-Line Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4
Least-Squares Approximation by Cubic Splines . . . . . . . . . . . . . . . . 11-5

Solving A Nonlinear ODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6


Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6
Approximation Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6
Discretization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6
Numerical Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7
Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7
Linear System to Be Solved . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7
Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8

Construction of the Chebyshev Spline . . . . . . . . . . . . . . . . . . . . . . . 11-10


What Is a Chebyshev Spline? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10
Choice of Spline Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10
Initial Guess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10
Remez Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-11

Approximation by Tensor Product Splines . . . . . . . . . . . . . . . . . . . 11-14


Choice of Sites and Knots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-14
Least Squares Approximation as Function of y . . . . . . . . . . . . . . . 11-14
Approximation to Coefficients as Functions of x . . . . . . . . . . . . . . 11-15
The Bivariate Approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-16
Switch in Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-17
Approximation to Coefficients as Functions of y . . . . . . . . . . . . . . 11-18
The Bivariate Approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-19
Comparison and Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-20

Splines Glossary
A
List of Terms for Spline Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2

xii Contents
Functions
12

Bibliography
B

xiii
1

Getting Started

• “Curve Fitting Toolbox Product Description” on page 1-2


• “Curve Fitting Tools” on page 1-3
• “Curve Fitting” on page 1-4
• “Surface Fitting” on page 1-6
• “Spline Fitting” on page 1-8
1 Getting Started

Curve Fitting Toolbox Product Description


Fit curves and surfaces to data using regression, interpolation, and smoothing

Curve Fitting Toolbox provides an app and functions for fitting curves and surfaces to data. The
toolbox lets you perform exploratory data analysis, preprocess and post-process data, compare
candidate models, and remove outliers. You can conduct regression analysis using the library of
linear and nonlinear models provided or specify your own custom equations. The library provides
optimized solver parameters and starting conditions to improve the quality of your fits. The toolbox
also supports nonparametric modeling techniques, such as splines, interpolation, and smoothing.

After creating a fit, you can apply a variety of post-processing methods for plotting, interpolation, and
extrapolation; estimating confidence intervals; and calculating integrals and derivatives.

Key Features
• Curve Fitting app for curve and surface fitting
• Linear and nonlinear regression with custom equations
• Library of regression models with optimized starting points and solver parameters
• Interpolation methods, including B-splines, thin plate splines, and tensor-product splines
• Smoothing techniques, including smoothing splines, localized regression, Savitzky-Golay filters,
and moving averages
• Preprocessing routines, including outlier removal and sectioning, scaling, and weighting data
• Post-processing routines, including interpolation, extrapolation, confidence intervals, integrals and
derivatives

1-2
Curve Fitting Tools

Curve Fitting Tools


Curve Fitting Toolbox software allows you to work in two different environments:

• An interactive environment, with the Curve Fitting app and the Spline Tool
• A programmatic environment that allows you to write object-oriented MATLAB® code using curve
and surface fitting methods

To open the Curve Fitting app or Spline Tool, enter one of the following:

• cftool. See Curve Fitting.


• splinetool

To list the Curve Fitting Toolbox functions for use in MATLAB programming, type

help curvefit

The code for any function can be opened in the MATLAB Editor by typing

edit function_name

Brief, command line help for any function is available by typing

help function_name

Complete documentation for any function is available by typing

doc function_name

You can change the way any toolbox function works by copying and renaming its file, examining your
copy in the editor, and then modifying it.

You can also extend the toolbox by adding your own files, or by using your code in combination with
functions from other toolboxes, such as Statistics and Machine Learning Toolbox or Optimization
Toolbox software.

1-3
1 Getting Started

Curve Fitting

Interactive Curve Fitting


To interactively fit a curve, follow the steps in this simple example:

1 Load some data at the MATLAB command line.

load hahn1
2 Open the Curve Fitting app. Enter:

cftool
3 In the Curve Fitting app, select X Data and Y Data.

Curve Fitting app creates a default interpolation fit to the data.


4 Choose a different model type using the fit category drop-down list, e.g., select Polynomial.
5 Try different fit options for your chosen model type.
6 Select File > Generate Code.

Curve Fitting app creates a file in the Editor containing MATLAB code to recreate all fits and
plots in your interactive session.

For more information about fitting curves in the Curve Fitting app, see “Interactive Curve and
Surface Fitting” on page 2-2.

For details and examples of specific model types and fit analysis, see the following sections:

1 “Linear and Nonlinear Regression”


2 “Interpolation”
3 “Smoothing”
4 “Fit Postprocessing”

Programmatic Curve Fitting


To programmatically fit a curve, follow the steps in this simple example:

1 Load some data.

load hahn1

Create a fit using the fit function, specifying the variables and a model type (in this case rat23
is the model type).

f = fit( temp, thermex, 'rat23' )

Plot your fit and the data.

plot( f, temp, thermex )


f( 600 )

To learn what functions you can use to create and work with fits, see: “Curve and Surface Fitting” on
page 3-2.

1-4
Curve Fitting

For details and examples of specific model types and fit analysis, see the following sections:

1 “Linear and Nonlinear Regression”


2 “Interpolation”
3 “Smoothing”
4 “Fit Postprocessing”

See Also
fit

Related Examples
• “Interactive Curve and Surface Fitting” on page 2-2

1-5
1 Getting Started

Surface Fitting

Interactive Surface Fitting


To interactively fit a surface, follow the steps in this simple example:

1 Load some data at the MATLAB command line.

load franke
2 Open the Curve Fitting app. Enter:

cftool
3 In the Curve Fitting app, select X Data, Y Data and Z Data.

Curve Fitting app creates a default interpolation fit to the data.


4 Choose a different model type using the fit category drop-down list, e.g., select Polynomial.
5 Try different fit options for your chosen model type.
6 Select File > Generate Code.

Curve Fitting app creates a file in the Editor containing MATLAB code to recreate all fits and
plots in your interactive session.

For more information about fitting surfaces in the Curve Fitting app, see “Interactive Curve and
Surface Fitting” on page 2-2.

For details and examples of specific model types and fit analysis, see the following sections:

1 “Linear and Nonlinear Regression”


2 “Interpolation”
3 “Smoothing”
4 “Fit Postprocessing”

Programmatic Surface Fitting


To programmatically fit a surface, follow the steps in this simple example:

1 Load some data.

load franke
2 Create a fit using the fit function, specifying the variables and a model type (in this case
poly23 is the model type).

f = fit( [x, y], z, 'poly23' )


3 Plot your fit and the data.

plot(f, [x,y], z)

To learn what functions you can use to create and work with fits, see: “Curve and Surface Fitting” on
page 3-2.

For details and examples of specific model types and fit analysis, see the following sections:

1-6
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Surface Fitting

1 “Linear and Nonlinear Regression”


2 “Interpolation”
3 “Smoothing”
4 “Fit Postprocessing”

See Also
fit

Related Examples
• “Interactive Curve and Surface Fitting” on page 2-2

1-7
1 Getting Started

Spline Fitting

In this section...
“About Splines in Curve Fitting Toolbox” on page 1-8
“Interactive Spline Fitting” on page 1-8
“Programmatic Spline Fitting” on page 1-8

About Splines in Curve Fitting Toolbox


You can work with splines in Curve Fitting Toolbox in several ways.

Using the Curve Fitting app or the fit function you can:

• Fit cubic spline interpolants to curves or surfaces


• Fit smoothing splines and shape-preserving cubic spline interpolants to curves (but not surfaces)
• Fit thin-plate splines to surfaces (but not curves)

The toolbox also contains specific splines functions to allow greater control over what you can create.
For example, you can use the csapi function for cubic spline interpolation. Why would you use
csapi instead of the fit function 'cubicinterp' option? You might require greater flexibility to
work with splines for the following reasons:

• You want to combine the results with other splines, e.g., by addition.
• You want vector-valued splines. You can use csapi with scalars, vectors, matrices, and ND-arrays.
The fit function only allows scalar-valued splines.
• You want other types of splines such as ppform, B-form, tensor-product, rational, and stform thin-
plate splines.
• You want to create splines without data.
• You want to specify breaks, optimize knot placement, and use specialized functions for spline
manipulation such as differentiation and integration.

If you require specialized spline functions, see the following sections for interactive and
programmatic spline fitting.

Interactive Spline Fitting


You can access all spline functions from the splinetool GUI.

See “Introducing Spline Fitting” on page 8-2.

Programmatic Spline Fitting


To programmatically fit splines, see “Spline Construction” for descriptions of types of splines and
numerous examples.

1-8
2

Interactive Fitting

• “Interactive Curve and Surface Fitting” on page 2-2


• “Data Selection” on page 2-8
• “Create Multiple Fits in Curve Fitting App” on page 2-11
• “Generating MATLAB Code and Exporting Fits” on page 2-15
• “Compare Fits in Curve Fitting App” on page 2-16
• “Surface Fitting to Franke Data” on page 2-26
2 Interactive Fitting

Interactive Curve and Surface Fitting


In this section...
“Introducing the Curve Fitting App” on page 2-2
“Fit a Curve” on page 2-2
“Fit a Surface” on page 2-3
“Model Types for Curves and Surfaces” on page 2-4
“Selecting Data to Fit in Curve Fitting App” on page 2-5
“Save and Reload Sessions” on page 2-6

Introducing the Curve Fitting App


You can fit curves and surfaces to data and view plots with the Curve Fitting app.

• Create, plot, and compare multiple fits.


• Use linear or nonlinear regression, interpolation, smoothing, and custom equations.
• View goodness-of-fit statistics, display confidence intervals and residuals, remove outliers, and
assess fits with validation data.
• Automatically generate code to fit and plot curves and surfaces, or export fits to the workspace for
further analysis.

Fit a Curve
1 Load some example data at the MATLAB command line:
load census
2 Open the Curve Fitting app by entering:
cftool

Alternatively, click Curve Fitting on the Apps tab.


3 Select X data and Y data. For details, see “Selecting Data to Fit in Curve Fitting App” on page 2-
5.

The Curve Fitting app creates a default polynomial fit to the data.
4 Try different fit options. For example, change the polynomial Degree to 3 to fit a cubic
polynomial.

2-2
Interactive Curve and Surface Fitting

5 Select a different model type from the fit category list, e.g., Smoothing Spline. For information
about models you can fit, see “Model Types for Curves and Surfaces” on page 2-4.

6 Select File > Generate Code.

The Curve Fitting app creates a file in the Editor containing MATLAB code to recreate all fits and
plots in your interactive session.

Tip For a detailed workflow example, see “Compare Fits in Curve Fitting App” on page 2-16.

To create multiple fits and compare them, see “Create Multiple Fits in Curve Fitting App” on page 2-
11.

Fit a Surface
1 Load some example data at the MATLAB command line:

load franke
2 Open the Curve Fitting app:

cftool
3 Select X data, Y data, and Z data. For more information, see “Selecting Data to Fit in Curve
Fitting App” on page 2-5.

2-3
Random documents with unrelated
content Scribd suggests to you:
Dunkirk, 32
Duquesne, Fr., 130–31
Echo, 41
L’Éclair, Fr. corvette, capture of, 126
Edgar, Gardner’s service in, 64–96;
court martial on board of, 73–4;
officers of, 90–6; 29, 39, 45, 52, 97, 108, 112, 118, 124, 157, 229,
233
Elephant, 227–8, 232
Endymion, 72–3
Etna, 12
Europa, 205, 222
Euryalus, 202
Fame, 11
Favorite, Fr. privateer, captured, 188;
in Portland Race, 189;
luxuries on board of, 200
Formidable, 182, 228
Fortitude, 104, 143
Foudroyant, 7, 29, 62, 117, 136
Française, Fr., 230
Ganges, 227, 229
Glebb, Russian, 184
Glorieux, French prize, lost, 26
Goliath, 25, 30, 226, 228, 234, 239
Gorgon, Gardner’s service in, 155–71;
goes ‘bump on shore,’ 156;
‘a noble sea boat,’ 157;
nearly runs on Bolt Head, 158;
runs amok at Spithead, ib.;
officers of, 170–1
Grafton, 11
Grampus, 51
Growler, brig, capture of, 95
Guadeloupe, 11
Hebe, 57, 65
Hector, French prize, lost, 26
Hector, guard-ship, 76
Hercules, Dutch prize, renamed Orestes, 56
Hercules, 80
Hermione, French prize, victualler, 22
Hermione recaptured, 176
Hind, 44, 176;
Gardner’s service in, 178–202;
captures smuggler, 181;
presses her crew, 181;
succession of gales, 182–185;
chased by Richery’s squadron, 185–7;
captures French privateer, 188;
officers put on shore in the mutiny, 192–3;
officers of, 201–2
Hindostan, store-ship, 229
Hope, transport, 37
Hope, 74
Illustrious, 131, 146
Impregnable, 14
Invincible, the old, lost on the Dean, 6;
the new, 11
Jamaica, 18
Janus, 233
Juno, frigate, 143
Languedoc, Fr., 74
Lark, 230
Lawrence, brig, 41
Leopard, 180
Leviathan, 78, 228
Lion, 62, 233
London, 12, 81;
mutiny at Spithead, 192
Lowestoft, 131
Lutine, 202;
loss of, 208
Macedonian, capture of, 95
Magnificent, 64
Majestic, 229
Marlborough, 8, 117
Mars, Dutch prize, renamed Pylades, 56
Mars, 5, 8
Medusa, 182, 192
Medway, 33
Melampus, 227, 229
Merlin, 41
Minerve, 66
Minotaur, 123, 125
Modeste, 155–6
Monmouth, 10, 136, 197, 243
Monsieur, 22–3
Montagu, 184
Naiad, 229
Namur, 197
Nassau, loss of, 213
Nemesis, 131
Néréide, 229
Orestes, a prize from the Dutch, 56;
Gardner’s service in, 56–63;
fire on board, 57;
loss of, 62;
officers of, 62–3
Orion, 229, 233
Overyssel, 203 n.
Pallas, formerly Minerva, 213
Panther, Gardner’s service in, 19–40;
messing on board, 20–21;
makes three prizes, 22;
in a gale, 25–6;
at Gibraltar, 27;
off C. Spartel, 29–32;
regrets at paying off, 33;
mutinous spirit of men, 37;
officers of, 38–40, 179
Pearl, 155–6
Pégase, 80, 88
Pelican, 230
Penelope, 62
Phæton, courts martial on captain and officers of, 73–4 n.
Pigmy, cutter, prize, 22
Powerful, 229, 232–3
Preston, 104, 147
Prince George, 10, 91, 188
Princess Amelia, song by a seaman of, 103–4
Princess Charlotte, accident at the launch of, 238–9
Princess Royal, 11–13, 80, 129, 213, 228, 247
Proselyte, court martial on master of, 41
Proserpine, capture of, 116
Pylades, 56
Quebec, 244
Queen, Gardner’s service in, 121–5;
officers of, 123–5, 82, 87
Queen Charlotte, 98
Raisonnable, 21, 29
Ramillies, 12, 13
Rattler, sloop, 94
Raven, 230
Recovery, 22
Renown, 74
Resolution, 229
Ripon, 22
Robust, 229
Romney, 102
Rose, transport, 37
Rover, sloop, lost, 8
Royal George, loss of, 23–4; 8, 52, 99
Royal Louis, Fr., 30
Royal Oak, 11
Royal Sovereign, 13
Royal William, 24, 29, 158
Ruby, 29, 151
Russell, 11
Sabina, Spanish frigate, 66
St. Fiorenzo, 155–6
St. George, loss of, 113, 129, 145
St. Michael, prize, 27
Salisbury, Gardner’s service in, 41–52;
Hell afloat, 41, 75;
dogs on board, 42;
fog off Newfoundland, 42;
in a gale, 43;
logged 296 k. in 24 hours, 43;
much bullying on board, 43–6;
feud with Grampus, 50, 51;
officers of, 52–5; 68, 114–116, 120, 175–7
Sandwich, 23
Sans Culotte, Fr., renamed l’Orient, 145
Sans Pareil, 114, 227–8
Santa Leocadia, 41
Saturn, 81
Scipio, 65
Solebay, 97
Solitaire, Fr., capture of, 151
Speedwell, smuggling lugger, capture of, 181
Speedy, brig, 131
Spencer, 228
Standard, 203
Stately, 99
Suffolk, 22
Sultan, 11
Superb, 38
Surveillante, Fr., 244
Temeraire, 228
Terpsichore, 116
Terrible, 145
Theseus, 229
Thisbe, 41, 229
Thorn, 41
Thunderer, lost, 50
Tonnant, Fr., 147 n.
Topaze, heavy death-roll, 230; 155–6
Tremendous, 198
Trent, 196, 229
Trimmer, 65
Tromp, 206 n.
Trusty, 242
Union, 29
Unité, 131
Valiant, 98, 148
Vanguard, 229
Vengeance, 25, 28–9, 227, 229–30, 233
Victory, lost on the Casquets, 100 n.;
carries Howe’s flag, 25, 29;
Gardner’s service in, 172–6;
officers of, 176–7; 54, 66, 99, 126, 148, 152, 158
Vigilant, 22
Ville de Paris, lost, 26
Warrior, 229
Weasel, 191
Weymouth, store-ship, 206
William Tell, 62
Woolwich, store-ship, 171
Zealous, 229, 233
Shirley, lieutenant, 133–4, 136, 152
Shirt in the rigging, 163 and n.
Shovell, Sir Clowdisley, his last moorings, 158
Shuldham, Lord, vice-admiral, 32
Silence in working ship, 108 & n.
Silva, Emanuel, midshipman, 94, 118
Simmers, Mr., his dog, 5–6
Simmonds, Mr., formerly of the Panther, 179
Simmonds, Richard, lieutenant, ‘Gentleman Jack,’ 114
Simmonds, Samuel, midshipman, sees ghost, 36; 39
Simmonds, Richard, midshipman, 117, 177
Simonton, Robert, captain, 21, 28, 38
Skene, midshipman, 18
Skerret, Robert, midshipman, 40, 54
Skinner, Stephen, midshipman, 116
Skynner, Launcelot, captain, his ship lost, 208
Slade, James, midshipman, 93
Slops, list of, 46;
‘served out at the gangway,’ 111 n.
Smith, Charles, gunner, 53
Smith, Sir Sidney, burns ships at Toulon, 145 n.
Smith, Walter, lieutenant of marines, 13
Smock frock, mention of, 46 & n.
Smollett, his monument, 143 n.
Snow-eaters, 51
Soap-suds, a pedantic lieutenant so called, 109
Songs and Verses:—
Prologue, 1
To my veteran friends, 3
‘Don’t you see the ships a-coming?’ 16
Commodore Gale, 69
On asking for leave, 72
‘There’s nothing like grog,’ 77
‘When first they impressed me,’ 84
On washing the decks, 88
The battle on the Dogger Bank, 103–4
‘Billy the cook got drunk,’ 104
On General Dundas, 148
Bryan O’Lynn, 168–9
On two lubberly pilots, 211
On Fegan’s impressment, 214–15
A Baltimore wedding, 215–216
Eileen Aroon, 222
‘Jolly tars, have you heard the news?’ 235
‘On Newgate Steps,’ 242
On Venables and Penn, 245
Spence, David, midshipman, 95
Spencer, Earl of, first lord of the admiralty, 44, 174–6
Spicer, Robert, midshipman, 119
Stack, Thomas, his yarns, 50; 55
Stamp, mayor of Queensborough and pilot, 180
Stephens, George Hopewell, captain, 226–7, 229, 231, 233–4, 236,
243, 246–7
Sterne, his Sentimental Journey, 143 n.
Stevens, midshipman, 61, 63;
complimented by Sir Roger Curtis, 61;
made a gunner, 63
Stevens, John, mate, 91
Stevenson, captain, keeps the Blue Peter flying, 222–3
Steward sewed up in a bullock’s hide, 135
Stewart, Charles, lieutenant, 151
Stiles, John, lieutenant, 45, 52, 68–9, 91
Stocker, Charles Maurice, lieutenant, killed in action, 114
Storace, musical composer, song by, 72
Strahan, Sir Richard, captures Dumanoir’s squadron, 201
Street, James, purser, 62
Strico, Anthony, his sign, 128
Sturges, Robert, midshipman, killed in action, 30;
his ghost walks, 36; 39
Suckling, William, 132 n.
Sumner, Dr., headmaster of Harrow, his death, 259 n.
Surgeon of Orestes violently mad, 57–8
Susan, Black-eyed, 36
Swanson, Jacob, gunner, 9
Swiney, Noel, midshipman, 125

Talbot, John, signal midshipman, K.C.B., 115


Tatham, midshipman, 116
Tause, Hector, gunner, 152
Taylor, surgeon in the navy, hanged, 18
Taylor, Andrew Bracey, lieutenant, 114
Taylor, James, midshipman, 39
Taylor, James, midshipman, afterwards pilot at Deal, 39
Taylor, R. A., midshipman, 249
Temperature at Jamaica, 231 n.
Temple, Francis, midshipman, 117
Test Act, 178 n.
Thomas, James, mate, 224
Thompson, Alexander, assistant surgeon, 40
Thompson, Andrew James, midshipman, 92
Thompson, Charles, captain, ‘gruff as the devil,’ 67;
his order as to dress, 68; 3, 7, 8, 64, 90, 115
Thompson, Edward, captain, poet, 51
Thompson, Lenox, mate, 8
Thompson, Norborne, midshipman, 55;
lieutenant, 115
Thompson, William, clerk, 125
Thornbrough, Edward, captain, 65
Thurot, his squadron captured, 112
Tidy, Thomas H., midshipman, 117
Tillman, acting lieutenant, 38
Tinling, Charles, midshipman, 124
Toby, Jonas, clerk, author of the plan of Trafalgar, 202
Tomlinson, clerk, 151;
misadventure on a donkey, 162
Towry, George Henry, captain, 145, 148, 151, 205
Trapani, historical associations of, 137;
the biter bit, 138;
mummied friars, 138–9
Tremlett, George, master, 52
Tremlett, George Neate, midshipman, 55
Tremlett, Richard Stiles, midshipman, killed in a duel, 55
Tresahar, John, midshipman, 95
Tripp, George, captain, court martial on, 213 and n.
Trogoff, French admiral, 170 n.
Trogoff, Madame, French admiral’s widow, 170
Trotter, Thomas, surgeon, author and poet, 91
Troughton, Ellis, lieutenant, 13
Tucker, John, purser, 224
Tucker, Robert, mate, 152
Tunis, the squadron at, 131–2;
Bey of, sends presents, 134–5
Turnips, dish of, 43 n.
Twisden, John, midshipman, 95
Tyler, Charles, captain, 65, 229
Tyrwhitt, John, midshipman, Marshal at Gibraltar, 54

Urry, John, captain, his hospitality, 58

Vagg, Henry, surgeon’s mate, runs amok with the snuffers, 149; 154
Valobra, James, midshipman, encounter with Turks, 133;
at Leghorn, 139; 153
Vansittart, Henry, midshipman, 177
Venables, his capture of Jamaica, 245
Ventriloquist, tricks of a, 84–5
Verses—see Songs
Vincent, Richard Budd, midshipman, 54;
lieutenant, 175–6
Vosper, William, Gardner’s schoolfellow, midshipman, 17, 72, 94,
142, 152

Waddle, coxswain, a noted boxer, 7


Waddle, J. H., writer, 249
Wade, John, master, 38
Wade, William, midshipman, 249
Wadeson, Richard, vicar of Fairlight, 259;
his high character, 260
Waghorn, Martin, captain, court martial on, 24 and n.
Walker, captain, 229
Walker, James, captain, broke by court martial, 242;
reinstated, ib.
Wall, William, lieutenant, court martial on, 73–4
Waller, Smithson, purser, 248
Wallis, surgeon, runs amok, 57–8; 63
Wallis, captain, 148, 155–6, 158–160, 168–70
Walsingham, commodore, lost in the Thunderer, 50
Wangford, George, midshipman and mate, 8;
death of, 75, 92
Wardrope, David, surgeon, court martial on, 73–4
Watson, boatswain, rope’s ends the schoolmaster, 77;
boatswain with Paul Jones, 96;
broke by court martial, 96
Watson, John, mate, 91
Watson, Thomas, a rugged-muzzled midshipman, 19–20;
a glorious noisy fellow, 39
Webb, Henry, master, his strange fancies, 216–17;
his adventure at Lisbon, 217;
chased by fishermen, 217–18;
his quarrel with the second lieutenant, 218, 224
Webb, Noah, lieutenant, 107
Weevil victualling yard, 107 n.
Welland, Richard, lieutenant, 90
Weller, Hannah, supposed witch, 256–7
Whistler, Webster, rector of Hastings and New-Timber, 260;
a militant parson, 261–2
White, George, the purser, put on shore in the mutiny, 193; 201
White, Robert, surgeon, 13
Wilkie, John, master, court martial on, 73, 74
Wilkinson, John, lawyer, 18
Wilkinson, William, midshipman, 93
Willcocks, William, clerk, 55
William Henry, H.R.H. Prince (afterwards William IV.), captain 65;
visits the Barfleur, 98;
Duke of Clarence, 148
Williams, lieutenant, 13
Williams, William, lieutenant of marines, 8
Wills, Methuselah, master, anecdotes of, 237–8, 247–8
Wilson, Robert, midshipman, died of yellow fever, 249
Wilson, Thomas, surgeon’s mate, 9
Wiseman, William, gunner, 248
Wolfe, George, midshipman and mate, 176
Wolridge, captain, 174
Wolseley, William, captain, 131 n.
Woodley, captain, 131
Wooldridge, William, midshipman, 124
Worrall, John, lieutenant, 224
Worsley, captain, 206

Yates, Thomas L., purser, puts the island of Pantalaria into


quarantine, 137;
at the carnival, 140; 152
Yelland, William, carpenter, 236, 248
Yetts, John, lieutenant, his strange dress and manners, 70;
his character, 71;
song on, 72;
hates the Barfleur, 85–6; 90
Yetts, Robert, midshipman, 94;
invalided, 151
Yorke, Sir Joseph, strings in his shoes, 108; 189
Young, Mrs., an infernal vixen, 161
Young, Mr., keeps an hotel at Cadiz, 161
1. It is not out of place to mention here what we were told many years ago by
an officer of the Conway, that the late Professor Montague Burrows, when a
lieutenant of the Winchester, was initiated in the mysteries of the Greek Grammar
by the late Sir Anthony Hoskins, then a cadet fresh from Westminster. Burrows
afterwards took a first class in classics at Oxford.
2. D.N.B.—In 1780, commander-in-chief in the Channel; baronet in 1782. Died
in 1796.
3. Charnock, v. 350. Died in 1779.
4. It was then, and for many years afterwards, quite usual for a youngster to be
at school while his name was on the ship’s books. When—as in this case—the boy
was his father’s servant, he might be on board while the ship was in a home port.
5. The heroine of a low-class chap-book, The Adventures of Moll Swanson of
Portsmouth, which may still occasionally be met with.
6. Born in 1720; died 1830. His portrait, painted shortly before his death, is in
the Painted Hall at Greenwich. See post, p. 213.
7. This was then usual. Probably the fate of the Ramillies had a good deal to do
with putting it out of fashion, as it certainly had with forcing seamen to consider
that there was a right and a wrong tack on which to lie to; and may thus be said to
have brought about the discovery of the Law of Storms.
8. There is no reason to doubt the fact; but, in the absence of Christian name
and date, the court martial cannot be traced; nor can any man of the name be
found, as surgeon, in the pay-books of the Jamaica.
9. Large holystones, fitted with beckets, were drawn about by two men. The
smaller ones, used in the hand, were ‘hand organs.’
10. Coarse red wine of any country, but very commonly Spanish or
Portuguese.
11. The brass knockers, when met with, were probably trophies of a night’s
foray. Such things have been known within the memory of not-very-old men.
12. Samuel Reeve died a vice-admiral, in 1802. Cf. N.R.S. xx. 111.
13. The names are filled in from Beatson.
14. Sc. the foot-rope.
15. Commander-in-Chief of the French fleet in the battle of the 12th April.
16. The very persistent way in which this story of the loss of the Royal George
was spread abroad from the first, the entire suppression of the evidence (on oath)
to the contrary, as given at the court martial, and the fact (here and elsewhere so
strongly commented on) that care was taken to prevent the success of the proposed
attempts to raise her, all point to one conclusion from which it is difficult to escape
—the conscious guilt of some high-placed and influential officials of the Navy
Board. Cf. Naval Miscellany (N.R.S. xx.) p. 216; and D.N.B. s.nn. Durham, Sir
Philip; Kempenfelt, Richard; Waghorn, Martin.
17. Sc. of France and Spain.
18. A ‘scuttle’ is defined by Falconer as ‘a small hatchway cut for some
particular purpose through a ship’s deck, or through the coverings of the
hatchways’; ‘scuttling’ is ‘the act of cutting large holes through the bottom or sides
of a ship.’ A ‘scuttle butt’ was a large cask, whose bung-hole had been cut into a
small scuttle, secured on the main deck in some convenient place, to hold water for
present use. It may be well to say that ‘scuttles’ to light the orlop deck were quite
unknown till long after the great war.
19. October 11th. Cf. N.R.S. xx. 217 seq.
20. So in MS.; but the word is ‘back-strapped,’ carried by the current to the
back of Gibraltar. The writing ‘black’ shows how entirely the meaning of the term
had been lost sight of. It is so with very many of the old nautical expressions.
21. More commonly known as the ‘floating batteries.’ They were burnt.
22. Neither Marshall nor Gardner seems to have realised the utterly worthless
character of the scurrilous book referred to—The Naval Atalantis, by ‘Nauticus
Junior,’ said to have been Joseph Harris, sometime secretary to Admiral Milbanke.
23. The pigsty, with its inmates, ‘under the forecastle,’ when going into action,
seems indeed ‘remarkable’ on board an English ship, even in 1782.
24. Sixteen years later, before the battle of the Nile, the live stock was
ruthlessly thrown overboard. Cf. Log of the Zealous (N.R.S. xviii. 12).
25. The statement is curious, for instances of similar escape are by no means
rare. In the days of sailing ships there can have been few officers of any seniority
who had not known of at least one.
26. The obsolete gibberish seems worth preserving, if only as a parallel to the
still familiar ‘So she went into the garden, &c.,’ attributed to Samuel Foote.
27. Now Devonport.
28. Sc. in nautical life.
29. Cf. Barrow, Life of Earl Howe, p. 165 seq.; Schomberg, Naval Chronology,
ii. 131.
30. Cf. post, p. 43.
31. Elder brother of Sir Francis Samuel Drake, Bart., but himself neither
baronet nor knight; and a vice-admiral at his death in 1788.
32. When in command of the Countess of Scarborough, hired ship.
33. Esteemed a good antiscorbutic. Our ships continued to brew it, up to 1840.
34. Possibly a pun on ‘turn-ing up Channel’ (cf. ante, p. 37); or a variation on
the familiar ‘playing hell and turn up Jack’ = ‘making things lively’ (cf. post, p. 65).
35. The list is interesting, as showing that, in 1785, a ‘smock frock’ was in the
slop-list.
36. This would seem to have been a mere short-lived association, with its head
quarters at St. John’s, and may, perhaps, be compared—with a difference—to the
nearly contemporary ‘Order of Marlborough,’ described in N.R.S. vi. 387. There are
obvious geographical reasons why it cannot have been connected with any foul
club of the name (there was a long succession of such) in London.
37. See Charnock, vi. 284.
38. Died, in command of the Grampus, 1786. See D.N.B.
39. The purser ‘was allowed one-eighth for waste on all provisions embarked.’
Provisions were thus issued at the ‘purser’s pound’ of 14 oz.—Smyth. In the mutiny
at Spithead in 1797, the seamen demanded and obtained an order that the pound
should in future be of 16 oz.
40. December 3, 1781.—Beatson, v. 424.
41. Or ‘Heck-boats.’ See Smyth, Sailors’ Word-Book.
42. Sc. crow-bar. Cf. Smyth, Sailors’ Word-Book.
43. More correctly, a-mok—a Malay term.
44. The full dress is perhaps meant.
45. John Urry, a captain of 1768; died 1800.
46. He died, admiral of the red, in 1837.
47. D.N.B.
48. Rear-admiral, 1794: died 1804.
49. Rear-admiral, 1794; died, admiral of the red, 1814.
50. D.N.B.
51. John Culverhouse, 1st lieutenant of the Minerve, was made commander for
the capture of the Spanish frigate Sabina, on the special recommendation of
Nelson. Captain, 1802. Drowned when agent for transports at the Cape of Good
Hope in 1809.—Nicolas, Nelson Despatches (Index).
52. Byam Martin’s recollection of Leveson Gower was even more unfavourable
than Gardner’s. Cf. N.R.S. xix. 292.
53. The ‘Belfry’—which has long been obsolete—is defined by Smyth as ‘an
ornamental frame or shelter, under which the ship’s bell is suspended.’ It would
seem to have been commonly fixed on the break of the forecastle, and is so shown
in the models in the Museum of the Royal United Service Institution.
54. Misappropriation of government stores (Smyth, Sailors’ Word-Book). Cf.
N.R.S. xxviii. 48. A writer in Notes and Queries (X. ii. 397) refers the term to the
Dutch ‘te kaap varen’ = to go a-privateering (N.E.D., s.v. Cape); a not improbable
derivation.
55. Musical composer, died 1796. Cf. D.N.B.
56. See in the Record Office (Admiralty, Sec. In Letters, 5326), the minutes of
these curious and remarkable courts martial—on David Wardrope, the surgeon, for
drunkenness, quarrelling and beating the lieutenants: death; on William Wall and
John Lucas, lieutenants, for permitting themselves to be beaten: dismissed the
ship; on George Dawson, captain, for tyranny, oppression, malversation, suttling
and such like: dismissed the service; and on John Wilkie, the master, for neglect of
duty, disobedience, disrespect and drunkenness: dismissed the ship.
57. Le Languedoc, 80, D’Estaing’s flagship. She had been previously dismasted
in a gale. Cf. Beatson, iv. 348; Chevalier, i. 117.
58. Syrup of maidenhair, flavoured with orange-flower.
59. There are not so many readers of Ossian now as there were a hundred
years ago, and the description given of this Spirit may be novel. ‘Connal lay by the
sound of the mountain stream, beneath the aged tree.... At distance from the
heroes he lay; the son of the sword feared no foe. The hero beheld, in his rest, a
dark-red stream of fire rushing down from the hill. Crugal sat upon the beam, a
chief who fell in fight.... His face is like the beam of the setting moon. His robes are
of the clouds of the hill. His eyes are two decaying flames. Dark is the wound of his
breast....’—Fingal, ii.
60. Without quite being ‘one of the first mathematicians in Europe,’ it is
probable enough that Macbride was really an able man. The old schoolmasters
were of two sorts: either they were respectable, half-educated men, who were rising
in life and sometimes became pursers, occasionally even lieutenants; or, and more
commonly, they were clever, highly educated men, ruined by drink, and on the
down grade. We may believe that Macbride was a man of this stamp. Cf. also Byam
Martin’s experience on board the Pegasus (N.R.S. xxiv. 57). Some of our most
distinguished captains and admirals endeavoured, at their own expense, to remedy
this utterly disgraceful state of things:—e.g. Pellew in the Caledonia, Sir Samuel
Hood in the Centaur; but it was not till 1836 that the Admiralty tried to make an
entirely new departure by the institution of naval instructors. Complete success,
however, came very gradually. Some of the earlier officers so appointed were not
uncommonly put to bed by a posse of their pupils; and even less than fifty years
ago, one of them—a capable instructor and a clever writer—went on four days’
leave to his cabin, in company with half a dozen of brandy. All might have gone
well—from his point of view—had not the supply run short after two days, and the
wretched man, in his night shirt and a state bordering on delirium tremens,
appeared in the ward room clamouring for drink.
61. Tyrannical and oppressive as a captain, but reputed a brave officer
previous to 1st June 1794. His conduct on that day led to his being tried by court
martial, and dismissed his ship—whether for cowardice, or for Howe’s inability to
make himself understood, may be doubted.
62. Marshall, iii. 89.
63. It will, of course, be remembered that all boats were then hoisted in; boat-
davits were unknown.
64. Marshall, iv. 1007.
65. ‘What! put a physician in a bread bag!’ is quoted as the remark of a newly
caught surgeon’s mate, on being shown his bed.
66. This superstitious dread of the raven was as common on shore as afloat
(see post, p. 258), and is by no means extinct even now.
67. Captain of the Prince George in the battle of Cape St. Vincent. Grand-uncle
of the late Sir George Willes.
68. As the admiral compared Mr. Pringle to a scuttle butt (ante, p. 67), there
would seem to be another meaning in the name.
69. The traditional meaning of the name is a curious comment on ‘the worthy
fellow.’
70. Whilst in command of the Growler brig, captured by French privateers,
21st Dec 1797.
71. Afterwards Sir Henry Martin, Bart., Comptroller of the Navy; died 1794.
See N.R.S., vol. xxiv. p. viii.
72. Howe was ordered to hoist the union jack, and considered himself as
‘brevet’ admiral of the fleet.
73. Son of Samuel Faulknor, captain of the Victory when she was lost on the
Casquets in 1744; uncle of Captain Robert Faulknor, the ‘Undaunted’; flag captain
with Keppel in 1778. Died, admiral of the blue, 1795.
74. The reference is possibly to the retreat from Burgos in November 1812.
75. Many did deny this, while admitting that he was ‘a brave and meritorious
officer.’
76. Billy Culmer is a familiar character in the gossiping memoirs of the old
war, e.g. Greenwich Hospital, by the Old Sailor (M. H. Barker). From Gardner’s
account of him, we may fairly believe that Barker’s anecdotes are also genuine. It is
noted in the Barfleur’s pay-book, that he was born in Bridgwater, and was 35 in
1790. Of course, this is by no means conclusive evidence of the fact.
77. If we are to accept the statement that he was 35 in 1790, he was two years
old in 1757. He may have been with Hood in the Romney in 1767–70.
78. The victualling yard, whose name was not inaptly transferred to the
biscuit-grub.
79. Sc. squinting.
80. Such silence was then very exceptional, and continued so till seventy years
later (1861–2), when Sir William Martin, commander-in-chief in the
Mediterranean, insisted on it.
81. The order which the midshipman brought from the flagship.
82. A periphrastic euphemism for to be flogged.
83. A puddening is defined as ‘a thick wreath of cordage, tapering from the
middle towards the ends’ (Falconer). The joke, such as it is, seems to refer to the
thickening in the middle.
84. Sc. with a rope’s end or a cane.
85. It is, perhaps, more probable that, at the extreme end of the roll, the sea
came up to the yard.
86. More likely they were carried away by the rolling. The wind might then
blow the boat away.
87. See a picture of this by Cruikshank in the Old Sailor’s Greenwich Hospital.
88. Looks like an early form of Esperanto.
89. Cf. James, i. 78.
90. The story of this attack and its repulse is given by Chevalier, Hist. de la
Marine Française sous la Première République, pp. 41 seq.
91. It has, of late years, been so persistently stated that black silk
handkerchiefs were introduced into the navy as a mark of mourning for Nelson,
that it is most refreshing to meet with this very positive contradiction of the story.
92. Charles Cunningham, at this time commander of the Speedy brig, was not
a captain till some months later, and was then posted to the Unité. The captain of
the Lowestoft was William Wolseley—Cf. D.N.B.
93. This is an allusion to the absurd story—which Gardner seems to have
believed—that James was American by birth. See D.N.B. In consequence of his
very free comments on the conduct of naval officers, James was far from being a
favourite in the service; and it must have been still fresh in Gardner’s memory that
he had been severely caned by Sir John Phillimore.
94. Nelson wrote to his uncle, William Suckling, that, in his opinion, we ought
to have taken them—men of war and convoy; and if ‘we had given the Bey 50,000l.
he would have been glad to have put up with the insult offered to his dignity.’
95. Bagrada is the classical name; the river is now called Mejerda.
96. In 1758.
97. For the story of these very remarkable sea fights, see Smith’s Dictionary of
Greek and Roman Biography &c.; U.S. Mag., Oct. 1889, pp. 690–1.
98. The fresco is attributed to Nardo Daddi. See Kugler’s Handbook of
Painting, Italian Schools (5th Edit), pp. 111, 112, where there is a drawing of ‘The
Last Judgment.’
99. Smollett, so called by Sterne in A Sentimental Journey. It is, however, a
much disputed point whether he was not buried at Leghorn. See Notes and Queries
(1898, i.), IX. i. pp. 201, 309, 510; but it will be noticed that the monument
Gardner saw was earlier than that at Leghorn, and his mention of the ‘remains’ at
Montenero is of earlier date than any evidence yet quoted in support of the
Leghorn claim.
100. Cf. James, i. 208. The effective defence of this tower—which took its
name from the place (Mortella = Myrtle)—suggested the erection, along our south
coast, of those numerous, useless, and misnamed Martello towers, against which
the poet Campbell vainly protested.
101. See ante, p. 130, n.
102. Nelson’s comment on the reappearance of these ships was not so
classical: ‘Sir Sidney Smith did not burn them all—Lord Hood mistook the man:
there is an old song, “Great talkers do the least, we see.”‘
103. Formerly Le Dauphin Royal, and afterwards L’Orient, burnt and blown
up at the Nile. She was really of 120 guns.
104. Golfe Jouan.
105. In April 1794. As no one was saved the details were never known. Cf.
Brenton, Naval History, ii. 52.
106. The Tonnant, of 80 guns, already dismasted in the storm. The capture
was prevented, not by a gale coming on, but by the arrival of other ships to her
assistance. Cf. ante, p. 74.
107. William IV., at that time Duke of Clarence.
108. So in MS. The name is now entirely unknown, but it may perhaps have
some relationship to ‘brown Bess.’
109. French ships brought from Toulon. Cf. Schomberg, Naval Chronology, iv.
471. It will be seen that the lists of these squadrons differ from Schomberg’s, which
are probably the more correct. The Alert, for instance, had been captured on the
coast of Ireland, in May.—James, i. 439.
110. A shirt in the rigging was the recognised signal from a merchantman for a
man of war boat to be sent on board.
111. The Dunciad, ii. 105. A reference to the original—of which only the tense is
here altered—will show the strict appositeness of the quotation.

You might also like