Class VEle

java.lang.Object
org.nfunk.jep.function.PostfixMathCommand
org.lsmp.djep.vectorJep.function.VEle
All Implemented Interfaces:
BinaryOperatorI, PostfixMathCommandI
Direct Known Subclasses:
ArrayAccess

public class VEle extends PostfixMathCommand implements BinaryOperatorI
ele(x,i) returns the i-th element of a vector x. ele(m,[i,j]) returns the (i-th,j-th) element of a matrix m. Note this follows the mathematical indexing convention with indices starting from 1 rather than the computer science convention with indices starting from 0. Hence a = [1,2,3,4]; ele(a,1); // returns 1 m = [[1,2],[3,4]]; ele(m,[2,2]); // return 4 New parser feature allow a[] notation to be used. a=[1,2,3,4]; a[3]; // returns 3 b=[[1,2],[3,4]]; b[1,2]; // returns 2
Author:
Rich Morris Created on 15-Nov-2003