okay so far -- though you can just use
Then
okay, A is 1 x 62 so its second dimension is 62, so n will be assigned 62.
Then
62 is a scalar, something that is size 1 by 1.
n is 62 so n+1 is 63. Then size(62, 63) is asking what the length is of the 63rd dimension of the 1 x 1 scalar that has value 62. In MATLAB, all trailing dimensions automatically have length 1 -- for example [5 6 7] is 1 x 3 x 1 x 1 x 1 x 1 x 1 x 1 x 1 ... indefinitely x 1. So size(62, 63) is 1. So C will become 1.
the ":" part is asking to write values into all rows of the scalar value 1 that is in C, which is a bit oddly phrased for this kind of task but is valid. The ,1:n+1 is going to be ,1:62+1 and with C only being 1 x 1, your left hand side is going to be C(1,1:63)
[A,B] meanwhile is the result of putting the 1 x 62 array in A together with the 1 x 62 array in B, which is a total of 124 elements.
So your left hand side is saying that you should store in the 63 locations from C(1,1) to C(1,63), but your right hand side of the assignment says that there are 124 values to write into those 63 locations.
Unfortunately your code has no comments about what your desired outcome was, so we do not know what to suggest to you as replacement.
Best Answer