Skip to content

linearfit2.m

Basic Information

  SYNTAX:  [p,norm_error] = linearfit2(data)

  PURPOSE:  Do a linear fit to data of y = p(1) + p(2)*x.
  This version assumes that the data is both x and y data.

  INPUT:
    data = 2 column matrix, 1st col. = independent variable, 2nd = dependent

  OUTPUT:
    p = vector of length 2:
        p(1) = constant offset
        p(2) = linear multiplier

  SEE ALSO: linearfit

Dependencies