A Simple Math Language

The following tokens can be expressions

If E is an expression then so is

If E1 and E2 are expressions then so is

If E11 E12 ... E1N, E21 E22 ... E2N ... are expressions then so is

All of these operators are left associatitive. The unary operators have highest precedence, followed by the element-wise operators (the ones starting with .), the arithmetic operators (+, -, *, /) and then the comparison operators.

If Identifier is a matrix variable, then

ones and zeros are functions that return matrices of the size of their number of arguments, ones(Expr) and zeros(Expr) return one dimensional matrices (vectors) of size Expr, ones of 1s and zeros of 0s, ones(Expr1,Expr2) and zeros(Expr1,Expr2) return two dimensional matrices of size Expr1,Expr2 and so on.

A statement S make take one of the following forms: