If I have a matrix
A = [0 1 0 1
0 0 1 1]
and a variable B = 121.23,
how can I concat both into a one variable.
I did
features_set = [A(:), B];
But, it gives an error CAT arguments dimensions are not consistent.
How can I add this variable B to the end of the vector A?
A(:)returns an 8-by-1 array. The comma appends along the second dimension. Thus, your code fails.If the output should be a 9-by-1 array, you should write
If the output should be a 1-by-9 array, you should write