function [label] = knn_classify(test_feat,train_feat1,train_feat2,train_feat3,n_neigh,n_trains)

    i = 1;
    while(i <= n_trains)
        diff_1(i,:) = train_feat1(i,:)-test_feat;
        diff_2(i,:) = train_feat2(i,:)-test_feat;
        diff_3(i,:) = train_feat3(i,:)-test_feat;
        i = i + 1;
    end
        
    i = 1;
    while(i <= n_trains)
        diff_vec1(i) = diff_1(i,:)*diff_1(i,:)';
        diff_vec2(i) = diff_2(i,:)*diff_2(i,:)';
        diff_vec3(i) = diff_3(i,:)*diff_3(i,:)';
        i = i + 1;
    end
    
    sorted_diff1 = sort(diff_vec1);
    sorted_diff2 = sort(diff_vec2);
    sorted_diff3 = sort(diff_vec3);
    
    diff1 = sum(sorted_diff1(1:n_neigh));
    diff2 = sum(sorted_diff2(1:n_neigh));
    diff3 = sum(sorted_diff3(1:n_neigh));
    
    diff = [diff1 diff2 diff3];
    min_diff = min(diff);        
    if(diff1 == min_diff)
        label = 1;  
    end        
    
    if(diff2 == min_diff)
        label = 0;
    end
    
    if(diff3 == min_diff)
        label = -1;
    end    
end

    
    
    
    
    

