Code covered by the BSD License  

Highlights from
Statistical Learning Toolbox

from Statistical Learning Toolbox by Dahua Lin
Functions for statistical learning, pattern recognition and computer vision, covering many topics.

Description of sladdvec
Home > sltoolbox > core > sladdvec.m

sladdvec

PURPOSE ^

SLADDVEC adds a vector to columns or rows of a matrix

SYNOPSIS ^

function Y = sladdvec(X, v, d)

DESCRIPTION ^

SLADDVEC adds a vector to columns or rows of a matrix

 $ Syntax $
   - Y = sladdvec(X, v, d)
   - Y = sladdvec(X, v)

 $ Arguments $
   - X:        The original matrix
   - v:        The addend vector
   - d:        The dimension along which the vector is to add
   - Y:        The resultant matrix

 $ Description $
   - Y = sladdvec(X, v, d) selects the most efficienct way to add a 
     vector v to every column/row of X. If d == 1, then v should be 
     a column vector, and is added to each column of X, if d == 2,
     then v should be a row vector, and is added to each row of X.

   - Y = sladdvec(X, v) will automatically determine d according to
     the shape of v.

 $ Remarks $
   - The implementation simply wraps the mex function vecop_core.

 $ History $
   - Created by Dahua Lin, on Sep 10, 2006

CROSS-REFERENCE INFORMATION ^

This function calls:
This function is called by:
  • sldistmean SLDISTMEAN Uses fast method to compute means of pairwise distances
  • slhistmetric_pw SLHISTMETRIC_PW Computes distance metrics between histograms pairwisely
  • slimginterp SLIMGINTERP Performs image based interpolation
  • slpixneighbors SLPIXNEIGHBORS Extracts the neighborhood of pixels from an image
  • sllocalcoordalign SLLOCALCOORDALIGN Performs optimal local coordinate alignment
  • sllocaltancoords SLLOCALTANCOORDS Computes the local tangent coordinates
  • sllocaltanspace SLLOCALTANSPACE Solves the local tangent spaces
  • sllogistreg SLLOGISTREG Performs Multivariate Logistic Regression
  • slcov SLCOV Compute the covariance matrix
  • slgaussest SLGAUSSEST Estimates the Gaussian models from samples
  • slgausspdf SLGAUSSPDF Computes the probability density of Gaussian models
  • slgaussrnd SLGAUSSRND Generates random samples from Gaussian models
  • slposteriori SLPOSTERIORI Computes the posterioris
  • slposterioritrue SLPOSTERIORITRUE Computes the posteriori that samples belong to true class
  • slapplypca SLAPPLYPCA Applies PCA model to samples
  • slcopca SLCOPCA Performs Coupled PCA Learning
  • slfld SLFLD Performs Fisher Linear Discriminant Analysis
  • slnlda SLNLDA Performs Nullspace-based Linear Discriminant Analysis
  • slpca SLPCA Learns a PCA model from training samples
  • slpcarecon SLPCARECON Reconstructs the samples in original space
  • slpartitionpca SLPARTITIONPCA Performs Partition-based PCA and saves the models
  • slpartitionpca_apply SLPARTITIONPCA_APPLY applies partition-based PCA to a set of arrays
  • slpartitionpca_construct SLPARTITIONPCA_CONSTRUCT Constructs the array from features
  • sldrawellipse SLDRAWELLIPSE Draws an ellipse on current axis

SOURCE CODE ^

0001 function Y = sladdvec(X, v, d)
0002 %SLADDVEC adds a vector to columns or rows of a matrix
0003 %
0004 % $ Syntax $
0005 %   - Y = sladdvec(X, v, d)
0006 %   - Y = sladdvec(X, v)
0007 %
0008 % $ Arguments $
0009 %   - X:        The original matrix
0010 %   - v:        The addend vector
0011 %   - d:        The dimension along which the vector is to add
0012 %   - Y:        The resultant matrix
0013 %
0014 % $ Description $
0015 %   - Y = sladdvec(X, v, d) selects the most efficienct way to add a
0016 %     vector v to every column/row of X. If d == 1, then v should be
0017 %     a column vector, and is added to each column of X, if d == 2,
0018 %     then v should be a row vector, and is added to each row of X.
0019 %
0020 %   - Y = sladdvec(X, v) will automatically determine d according to
0021 %     the shape of v.
0022 %
0023 % $ Remarks $
0024 %   - The implementation simply wraps the mex function vecop_core.
0025 %
0026 % $ History $
0027 %   - Created by Dahua Lin, on Sep 10, 2006
0028 %
0029 
0030 if nargin < 3
0031     if size(v, 2) == 1
0032         d = 1;
0033     else
0034         d = 2;
0035     end
0036 end
0037 
0038 Y = vecop_core(X, v, d, 1);  % 1 is the opcode of addition in vecop_core
0039 
0040 
0041 
0042 
0043 
0044 
0045 
0046     
0047

Generated on Wed 20-Sep-2006 12:43:11 by m2html © 2003

Contact us at files@mathworks.com