Update example.jl

Deleted unnecessary declarations of arrays.  
Simplified reshaping using vec()
Merge pull request #1 from eford/patch-1

Update example.jl