Setup And Loop Functions In Matlab