Home > matgraph > @permutation > subsref.m

subsref

PURPOSE ^

p(k) returns the result of p applied to k.

SYNOPSIS ^

function j = subsref(p,S)

DESCRIPTION ^

 p(k) returns the result of p applied to k. 
 If k is out of bounds, 0 is returned.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function j = subsref(p,S)
0002 % p(k) returns the result of p applied to k.
0003 % If k is out of bounds, 0 is returned.
0004 
0005 n  = length(p);
0006 args = S.subs;
0007 a = args(1);
0008 i = a{1};
0009 if (i<1) | (i>n)
0010     j = 0;
0011 else
0012     j = p.array(i);
0013 end

Generated on Thu 13-Mar-2008 14:23:52 by m2html © 2003