Products & Services Solutions Academia Support User Community Company

Learn more about Curve Fitting Toolbox   

islinear - Determine if cfit, sfit, or fittype object is linear

Syntax

flag = islinear(fun)

Description

flag = islinear(fun) returns a flag of 1 if the cfit, sfit, or fittype object fun represents a linear model, and a flag of 0 if it does not.

Example

f = fittype('a*x+b')
f =
     General model:
       f(a,b,x) = a*x+b

g = fittype({'x','1'})
g =
     Linear model:
       g(a,b,x) = a*x + b

h = fittype('poly1')
h =
     Linear model Poly1:
       h(p1,p2,x) = p1*x + p2

islinear(f)
ans =
     0
islinear(g)
ans =
     1
islinear(h)
ans =
     1

See Also

fittype

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS