On 9/9/2013 6:28 AM, cwc wrote: ... >> > Can someone explain to me the mechanics for a double for loop? >> > >> > [x,y] = size(z) >> > for ii = 1:x; >> > for jj = 1:y; >> > newz = z(ii,jj) >> > end >> > end >> > ...
> I can't seem to understand how the new matrix can become twice the size.
W/ the above code it can't.
And, in fact, in the above code newz will end up being a single value since you didn't subscript it the assignment will overwrite the variable each pass.