You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: figure_3.m
    path of file: ./repos/malini/Classifiers/RCE/classify
    
    the code of the file until where you have to start completion: function figure_3(groups,groups_train,num_genes,samples_scores,total_freq,...
                    uniq_groups,n_samples,s_names,TOP_RESAMPLE,upper_kfold,...
                    tp_rate,tn_rate,accuracy);
fgrp = groups(1);
i=2:n_samples

    
function figure_3(groups,groups_train,num_genes,samples_scores,total_freq,...
                    uniq_groups,n_samples,s_names,TOP_RESAMPLE,upper_kfold,...
                    tp_rate,tn_rate,accuracy);
fgrp = groups(1);
i=2:n_samples
sep=sum(ismember(groups(i),fgrp))+1;
l_indx = length(num_genes);
num_plots = 6;
for i=0:num_plots
    figure
    if (i == num_plots) 
        sum_scores = sum(samples_scores)'./(total_freq);
    else
        sum_scores = samples_scores(l_indx-i,:);
    end