
fprintf(fileID,'%s','\centering');fprintf(fileID,'\n');

cad = [];
for id_col = 1:length(x_labels)
    cad = [cad '| p{' num2str(cell_width) 'in} '];
end

fprintf(fileID,'%s',['	\begin{tabular}{| p{' num2str(cell_width) 'in} ' cad ' |}']);fprintf(fileID,'\n');

fprintf(fileID,'%s','\hline');fprintf(fileID,'\n');

for id_row = 1:size(y_labels,2)
    line_text = [];
    for id_col = 1:size(x_labels,2)

        
        if  ~reverse
            SingleFigureName = [ Model_ID '_ParametricCurve_' indicative '_id_' x_label '_' num2str(x_labels(id_col)) '_id_' y_label '_' num2str(y_labels(id_row)) '.png' ];
            filename = [ 'Figures/' Model_ID '/Plot_' num2str(id_plot) '/'  Model_ID '_ParametricCurve_' indicative '_id_' x_label '_' num2str(x_labels(id_col)) '_id_' y_label '_' num2str(y_labels(id_row)) '.png'];
        else
            SingleFigureName = [ Model_ID '_ParametricCurve_' indicative '_id_' y_label '_' num2str(y_labels(id_row)) '_id_' x_label '_' num2str(x_labels(id_col)) '.png' ];
            filename = [ 'Figures/' Model_ID '/Plot_' num2str(id_plot) '/'  Model_ID '_ParametricCurve_' indicative '_id_' y_label '_' num2str(y_labels(id_row)) '_id_' x_label '_' num2str(x_labels(id_col)) '.png'];
        end

        Total_Figures_Counter = Total_Figures_Counter + 1;
        if Total_Figures_Counter>max_num_Figures
            disp(['Maximum number of figures reached, current number = ' num2str(Total_Figures_Counter) ])
        else
            AllFigures{Total_Figures_Counter} = SingleFigureName;
        end
        
        if exist(['Chap/Opinion_Tools/' filename],'file')
        
            aux_text = ['\parbox[l]{0.05em}{\includegraphics[width=' num2str(cell_width) 'in]{Chap/Opinion_Tools/' filename '}}'];
        else
            aux_text = ' ';
            disp([9 'WARNING: ' 9 ' Figure ' 9 Model_ID '_ParametricCurve_' indicative '_id_' x_label '_' num2str(x_labels(id_col)) '_id_' y_label '_' num2str(y_labels(id_row)) '.png' 9 ' not found'])
        end

        if id_col == size(x_labels,2)
            line_text = [line_text aux_text '\\'];
        else
            line_text = [line_text aux_text '&'];
        end
    end

    fprintf(fileID,'%s',line_text);fprintf(fileID,'\n');
    fprintf(fileID,'%s','\hline');fprintf(fileID,'\n');

end



% NumberPlots  -> the number of plots
% NumberofLinesorPoints -> the number of lines or points
% LinesOrPoints -> whether it is lines or points

fprintf(fileID,'%s','	\end{tabular}');fprintf(fileID,'\n');
fprintf(fileID,'%s',['	\caption{' CompleteCaption  '}']);fprintf(fileID,'\n');










