1 of 19

�����Introduction to toolboxes useful to food industry, curve fitting toolbox, fuzzy logic toolbox, neural network toolbox, image processing toolbox, statistical toolbox.

COM 103 ICT Applications in Food Industry (1+2)

Lecture Schedule 7

Dr. S. Sridevy, Ph.D.

Assistant Professor (Computer Science)

Dept. of Physical Sciences & IT

AEC&RI, TNAU, Coimbatore – 3.

17 August 2020

2 of 19

MATLAB Toolbox

  • The toolbox is a collection of functions built on the MATLAB® technical computing environment.

S. Sridevy

17 August 2020

3 of 19

Curve Fitting Toolbox

  • Fit curves and surfaces to data using regression, interpolation (process of estimating unknown values that fall between the known values), and smoothing (process of removing noise from the data)
  • Curve Fitting Toolbox provides an app and functions for fitting curves and surfaces to data.

S. Sridevy

17 August 2020

4 of 19

Curve Fitting Toolbox (Contd.)

  • Toolbox lets to perform
    • exploratory data analysis, preprocess and post-process data, compare candidate models, and remove outliers.
    • regression analysis using the library of linear and nonlinear models provided or specify users own custom equations. The library provides
    • nonparametric modeling techniques, such as splines, interpolation, and smoothing.

S. Sridevy

17 August 2020

5 of 19

Curve Fitting Toolbox (Contd.)

  • After creating a fit, the toolbar lets to apply a variety of post-processing methods for plotting, interpolation, and extrapolation; estimating confidence intervals; and calculating integrals and derivatives.

S. Sridevy

17 August 2020

6 of 19

Curve Fitting Toolbox (Contd.)

  • 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

S. Sridevy

17 August 2020

7 of 19

Curve Fitting Toolbox (Contd.)

  • To open the Curve Fitting app enter

cftool

  • 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

S. Sridevy

17 August 2020

8 of 19

Curve Fitting Toolbox (Contd.)

  • 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

S. Sridevy

17 August 2020

9 of 19

Interactive Curve Fitting

  • Load some example data at the MATLAB command line

load census

  • Open the Curve Fitting app by entering:

cftool

  • Alternatively, click Curve Fitting on the Apps tab.

S. Sridevy

17 August 2020

10 of 19

Interactive Curve Fitting (Contd.)

  • Select X data and Y data.

S. Sridevy

17 August 2020

11 of 19

Interactive Curve Fitting (Contd.)

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

S. Sridevy

17 August 2020

12 of 19

Interactive Curve Fitting (Contd.)

  • Select a different model type from the fit category list, e.g., Smoothing Spline.

S. Sridevy

17 August 2020

13 of 19

Interactive Curve Fitting (Contd.)

  • Select File > Generate Code.
  • The Curve Fitting app creates a file in the Editor containing MATLAB code to recreate all fits and plots in interactive session.

S. Sridevy

17 August 2020

14 of 19

Interactive Surface Fitting

  • Load some example data at the MATLAB command line:

load franke

  • Open the Curve Fitting app:

cftool

S. Sridevy

17 August 2020

15 of 19

Interactive Surface Fitting (Contd.)

  • Select X data, Y data, and Z data.

S. Sridevy

17 August 2020

16 of 19

Interactive Surface Fitting (Contd.)

  • The Curve Fitting app creates a default interpolation fit to the data.
  • Select a different model type from the fit category list, e.g., Polynomial.

S. Sridevy

17 August 2020

17 of 19

Interactive Surface Fitting (Contd.)

  • Try different fit options for your chosen model type.
  • Select File > Generate Code.
  • The Curve Fitting app creates a file in the Editor containing MATLAB code to recreate all fits and plots in interactive session.

S. Sridevy

17 August 2020

18 of 19

Programmatic Curve Fitting

  • Load some data.

load _____

  • 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 )

S. Sridevy

17 August 2020

19 of 19

Thank You!

S. Sridevy

17 August 2020