About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

scripts default iconaddFitLine (Scripts) Publisher's description

The stats toolbox is required for the 'linear' and 'quadratic' options only.

The stats toolbox is required for the 'linear' and 'quadratic' options only.

function out=addFitLine(poolFits,modelType,lineprops,ax)

Add one or more fit lines to some or all data in axes "ax" or,
without ax specified, to the current axes.

*poolFits [optional 0 by default] -
if 1 we fit a single line to all data series on the current
*modelType ['linear' by default] - If 'linear' it fits a straight line
using the regress function from the stats toolbox. If 'quadratic' it
fits a second-order polynomial using regress. The output from regress is
returned. If modelType is an integer, the function fit a polynomial of
this order using polyfit, which is not part of the stats toolbox. The
output of polyfit is then returned.
*lineprops [optional 'b-' by default]
*ax [optional - gca by default]

out - the fit parameters and plot handles

%Fit two seperate lines
subplot(1,3,1), hold on, x=-5:0.1:5;
y=1+1*x+randn(size(x))*2; plot(x,y,'.k')
y=2-4*x+randn(size(x))*2; plot(x,y,'.r')

%Fit one line to two sets of data
subplot(1,3,2), hold on
x=-5:0.2:0; y=0.3*x+randn(size(x))*2; plot(x,y,'.k')
x=0:0.2:5; y=0.3*x+randn(size(x))*2; plot(x,y,'.r')

%Fit one quadratic

Rob Campbell - December 2009

System Requirements:

MATLAB 7.8 (R2009a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

addFitLine (Scripts) Tags:

Click on a tag to find related softwares

Is addFitLine (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.