convert another example to use SGVector/Matrix's i/o ops