Error using vertcat Dimensions of arrays being concatenated are not consistent.

1 view (last 30 days)
Hi everyone. I need to use SVM for prediction. hence, i need to combine my data
data1= 22x 7
data2 = 22 x 8
I dont know how to combine these two data . I used data3=[data1;data2], it does not work . Giving the error mentioned in title

Accepted Answer

the cyclist
the cyclist on 5 Jun 2021
data3 = [data1 data2]
will concatenate them horizontally rather than vertically. You can do that, because they have the same number of rows. You cannot do your way, because they do not have the same number of columns.

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!