if opt_plot

% plot trajectories
        color = colors(1 + mod(i, length(colors)));
        if plot_option == plot_phase
            vec_il = values(2, :);
            vec_vc = values(3, :);
            hold on;
            %marker = '.';
            marker = 'o';
            marker_size = 15;
            scatter(vec_il,vec_vc,marker_size,marker,'filled', color);
            %scatter(vec_il,vec_vc,marker, color);
            %scatter(vec_il,vec_vc, color, 'filled');
        elseif (plot_option)
            NUM_PLOTS = size(labels, 2);
            if (i == 1)
                % initialize plot structure
                p = zeros(1, NUM_PLOTS);
                for j = 1 : NUM_PLOTS
                    p(j) = subplot(NUM_PLOTS, 1, j);
                    xlabel(p(j), 'time');
                    ylabel(p(j), labels{j});
                    hold(p(j), 'on');
                end
            end
            
            % plot each variable in a single diagram
            for j = 1 : NUM_PLOTS
                %plot(p(j), time', values(j, :)', color);
                marker = 'o';
                marker_size = 10;
                scatter(p(j), time', values(j, :)', marker_size,marker,'filled', color);
                %scatter(p(j), time', values(j, :)', color);
            end
        else
            % plot all variables in one diagram
            plot(time', values', color);
            %scatter(time', values', color);
            %xlabel('time');
        end
end