5 is a scalar. A scalar has size 1x1.
On the second loop iteration a has size Nx2 (we don't know the actual size because you did explain what size angle is).
Then you calculate some trig functions using those 5 and a, giving 1x1 and Nx2 arrays. You then try to concatenate those arrays like this:
which is an error if N>1 because then the number of rows are different, which means that those arrays cannot be concatenated together horizontally:
- To horizontally concatenate arrays they must have the same number of rows.
- To vertically concatenate arrays they must have the same number of columns.
Check the sizes of the arrays that you are trying to concatenate and you will find that one/both of those conditions are not fulfilled.