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 sltakeval
Home > sltoolbox > utils > sltakeval.m

sltakeval

PURPOSE ^

SLTAKEVAL Extracts the values in an array/cell array to output

SYNOPSIS ^

function varargout = sltakeval(A)

DESCRIPTION ^

SLTAKEVAL Extracts the values in an array/cell array to output

 $ Syntax $
   -[O1, O2, ..., On] = sltakeval(A)

 $ Description $
   -[O1, O2, ..., On] = sltakeval(A) takes the values in the array
    or cell array A and assigns them to output variables.
    The number of elements in A should be equal to the number of
    output arguments.

 $ History $
   - Created by Dahua Lin, on Sep 1st, 2006

CROSS-REFERENCE INFORMATION ^

This function calls:
This function is called by:
  • slcalcpadsize SLCALCPADSIZE Calculates the size of padding
  • slpadimg SLPADIMG Pads an image with boundary
  • slpixneighbors SLPIXNEIGHBORS Extracts the neighborhood of pixels from an image
  • slresizeimg SLRESIZEIMG Resizes the images by interpolation

SOURCE CODE ^

0001 function varargout = sltakeval(A)
0002 %SLTAKEVAL Extracts the values in an array/cell array to output
0003 %
0004 % $ Syntax $
0005 %   -[O1, O2, ..., On] = sltakeval(A)
0006 %
0007 % $ Description $
0008 %   -[O1, O2, ..., On] = sltakeval(A) takes the values in the array
0009 %    or cell array A and assigns them to output variables.
0010 %    The number of elements in A should be equal to the number of
0011 %    output arguments.
0012 %
0013 % $ History $
0014 %   - Created by Dahua Lin, on Sep 1st, 2006
0015 %
0016 
0017 n = numel(A);
0018 if nargout ~= n
0019     error('sltoolbox:sizmismatch', ...
0020         'The number of elements in A is not equal to the number of outputs');
0021 end
0022 
0023 
0024 
0025 if n > 0
0026     if iscell(A)
0027         if isequal(size(A), [1, n])
0028             varargout = A;
0029         else
0030             varargout = reshape(A, 1, n);
0031         end
0032     else
0033         varargout = cell(1, n);
0034         for i = 1 : n
0035             varargout{i} = A(i);
0036         end
0037     end
0038 end

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

Contact us at files@mathworks.com