Update example.jl

Deleted unnecessary declarations of arrays.  
Simplified reshaping using vec()