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 slmax
Home > sltoolbox > core > slmax.m

slmax

PURPOSE ^

SLMAX Compute the maximum of values in subarrays

SYNOPSIS ^

function S = slmax(A, d)

DESCRIPTION ^

SLMAX Compute the maximum of values in subarrays

 $ Syntax $
   - S = slmax(A) 
   - S = slmax(A, d)
   - S = slmax(A, [d1 d2 ... dk])

 $ Arguments $
   - A:        the input array
   - d:        the dimensions along which the maximum is searched
   - S:        the resultant max matrix

 $ Description $
   - S = slmax(A) finds the maximums along column vectors of A. It is 
     equivalent to S = max(A)

   - S = slmax(A, d) finds the maximums along dimension d. It is 
     equivalent to S = max(A, [], d)

   - S = slmax(A, [d1 d2 ... dk]) finds the maximum values along dimension
     d1, d2, ... dk.

 $ History $
   - Created by Dahua Lin on Nov 19th, 2005

CROSS-REFERENCE INFORMATION ^

This function calls:
This function is called by:
  • slnorm SLNORM Compute the Lp-norms

SOURCE CODE ^

0001 function S = slmax(A, d)
0002 %SLMAX Compute the maximum of values in subarrays
0003 %
0004 % $ Syntax $
0005 %   - S = slmax(A)
0006 %   - S = slmax(A, d)
0007 %   - S = slmax(A, [d1 d2 ... dk])
0008 %
0009 % $ Arguments $
0010 %   - A:        the input array
0011 %   - d:        the dimensions along which the maximum is searched
0012 %   - S:        the resultant max matrix
0013 %
0014 % $ Description $
0015 %   - S = slmax(A) finds the maximums along column vectors of A. It is
0016 %     equivalent to S = max(A)
0017 %
0018 %   - S = slmax(A, d) finds the maximums along dimension d. It is
0019 %     equivalent to S = max(A, [], d)
0020 %
0021 %   - S = slmax(A, [d1 d2 ... dk]) finds the maximum values along dimension
0022 %     d1, d2, ... dk.
0023 %
0024 % $ History $
0025 %   - Created by Dahua Lin on Nov 19th, 2005
0026 %
0027 
0028 %% parse and verify input arguments
0029 if nargin < 2 || isempty(d)
0030     d = 1;
0031 end
0032 
0033 %% compute
0034 if isscalar(d)
0035     S = max(A, [], d);
0036 else
0037     k = length(d);
0038     S = A;
0039     for i = 1 : k
0040         S = max(S, [], d(i));
0041     end
0042 end
0043 
0044

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

Contact us at files@mathworks.com