%Function name: generate_y_ij
%Parameters: data (e.g. instances of class n)
function y = generate_y_ij(data)
    %Helper functions 
    rows = @(x) size(x,1);  %Gets number of rows in matrix
    cols = @(x) size(x,2);  %Gets number of cols in matrix

    %Get number of rows and cols in data
    data_rows = rows(data);
    data_cols = cols(data);

    %Initialize y_ij
    y = zeros(data_rows, data_rows);

    %Fill out y_ij with '1'
    for row=1:data_rows
        target_class = data(row, data_cols);
        for search_row=1:data_rows
            class = data(search_row, data_cols);
            if target_class == class
                y(row, search_row) = 1;
            end
        end
    end
end

