I think I figured it out... albeit probably the worst way possible. But it worked. in the first floop I just did xnew(1,(r*blahblah - blah):(r*blahblah)) = x.
Still open to what the experts have to say though.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!