MATLAB: How do i create new variable from 31 variables with one column

create variables dynamically

i have 31 variables with 1 column each variable and i want to create new variable from 31 variables with one column

Best Answer

vertcat(v1, v2, v3, v4, ...., v31)
or
horzcat(v1, v2, v3, v4, ...., v31)
The first of these would give you one single column of output, and the second of those would give you 31 columns.
The syntax [v1; v2; v3; ...; v31] is the same as vertcat(), and the syntax [v1, v2, v3, ..., v31] is the same as horzcat()