i1=dicomread('1.dcm');i2=dicomread('2.dcm');i3=dicomread('3.dcm');i4=dicomread('4.dcm');Sample=[i1; i2];Training=[i3; i4];Group=['1'; '2'];k=2;Class = knnclassify(Sample, Training, Group, k);disp(Class);
I get an error – The length of GROUP must equal the number of rows in TRAINING.
The size of both the images are same.
It works when I'm using co-ordinates instead of i1, i2 and so on.
I know I should be using fitcknn, but it should work as well. Any inputs please?
Best Answer