Site hosted by Angelfire.com: Build your free website today!

shiftl

PURPOSE ^

PURPOSE:

SYNOPSIS ^

function y = shiftl(A,row,shift,type)

DESCRIPTION ^

  PURPOSE:
  --------
  y = shiftl (A, row, shift) moves #row of matrix A to the left 
                                by #shift positions.

  INPUT ARGUMENTS:
  ----------------
  'A' is the input matrix. ('A' can be a vector)
  
  'row' is the number of the row to be shifted. If 'row' is zero,
  then all rows in the matrix are shifted.

  'shift' is the number of positions by which the row is shifted
  to the right.

  'type' is an optional argument.

         The shifted matrix-elements are discarded if this argument
         is 0 or is omitted,
         then vacated spaces to the right are filled with zeros.
  
         The shifted matrix-elements are retained if 'type' is 1 
         or any other non-zero value,
         then vacated spaces to the right are filled with the shifted
         row-elements from the left (i.e. "wraparound").

  EXAMPLES:   A = [1 2 3 4 5;
  ---------        6 7 8 9 0]

              y = shiftl(A,0,2)   --> [3 4 5 0 0;
                                       8 9 0 0 0]
              y = shiftl(A,1,2)   --> [3 4 5 0 0;
                                       6 7 8 9 0]
              y = shiftl(A,1,2,0) --> [3 4 5 0 0;
                                       6 7 8 9 0]
              y = shiftl(A,1,2,1) --> [3 4 5 1 2;
                                       6 7 8 9 0]
              y = shiftl(A,0,2,1) --> [3 4 5 1 2;
                                       8 9 0 6 7]
              B = [1 2 3 4 5]
 
              z = shiftl(B,1,3)   --> [4 5 0 0 0]

  SEE ALSO:  shiftr, shiftu, shiftd.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^


Generated on Sat 12-Mar-2005 01:01:49 by Rezaul Karim © 2004