Fix spelling error
Convert octave syntax to Matlab
Eliminate imaginary part of index