I have a 500*2 matrix. I want to plot this matrix such that it considered two separated matrix, for example, matrix A(1:250,1:2) and matrix B(251:500,1:2). There should be two scatter plots in one graph with two different colors (for example the scatter plot of matrix A will be blue and matrix B will be green). Finally, I need to check if they are linear separable, so one line should be added to the graph.
Some examples of the data:
x: -0.6683, -1.9977, -0.7086, 0.1071, -0.7550
Y: -1.6133, 0.5622, 0.2260, -3.3626, 1.4319
I used this code, but I faced this error: Error using specgraph.scattergroup/set Array must be numeric or logical.
AX = Classes(1:250,1);
AY = Classes(1:250,2);
BX = Classes(251:500,1);
BY = Classes(251:500,2);
scatter(AX, AY, 'b'); hold on;
scatter(BX, BY, 'g')
Could you please tell me what should I do?