Processing math: 100%

MathJax

Friday, January 10, 2014

Matlab parser notes

Matlab Grammar

 statements = statements (statements)*
 statement = declare | assign | expr
 clear = 'clear' id';'
 declare = 'global' id ';'
 assign = var '=' ( list | string | expr ) ';'
 var = id('.'id)* | id '(' expr (',' expr)* ')'
 literal = integer | float
 list = '[' expr (',' expr)* ']'
 expr = add_expr
 add_expr = mul_expr (('+'|'-') mul_expr )*
 mul_expr = primary (('*'|'/') primary )*
 primary = '(' expr ')' | var | list | literal | '-' primary

Token definition

 string = '[char]*'
 integer = [0:9]
 float = ...

Operator Precedence

You can build expressions that use any combination of arithmetic, relational, and logical operators. Precedence levels determine the order in which MATLAB® evaluates an expression. Within each precedence level, operators have equal precedence and are evaluated from left to right. The precedence rules for MATLAB operators are shown in this list, ordered from highest precedence level to lowest precedence level:
  1. Parentheses ()
  2. Transpose (.'), power (.^), complex conjugate transpose ('), matrix power (^)
  3. Unary plus (+), unary minus (-), logical negation (~)
  4. Multiplication (.*), right division (./), left division (.\), matrix multiplication (*), matrix right division (/), matrix left division (\)
  5. Addition (+), subtraction (-)
  6. Colon operator (:)
  7. Less than (<), less than or equal to (<=), greater than (>), greater than or equal to (>=), equal to (==), not equal to (~=)
  8. Element-wise AND (&)
  9. Element-wise OR (|)
  10. Short-circuit AND (&&)
  11. Short-circuit OR (||)

Associativity of operators

  • power (.^) is left associative in Matlab

Thursday, January 09, 2014

Compressed sensing notes

  • Classical sampling theory (Nyquist-Shannon framework) 
    • Infinite length, continuous-time signals 
    • Requires the sample at specific point in time 
    • Signal recovery in the form of linear sinc interpolation 
  • Compressed sensing framework 
    • Finite-dimensional vectors in Rn 
    • Acquires measurements in the form of an inner-products between the signal and a test function 
    • Signal recovery achieved using highly nonlinear methods

Wednesday, January 08, 2014

Trying out Math on Blogger

The following under determined equation Ax=b is an example.
Trying x1=3
baf(x)dx which we can later refer back to as (1).
In equation (2), we find the value of an interesting integral:
0x3ex1dx=π415 Very cool indeed.