% % plot_cell_data % function plot_cell_data(num_cells_to_plot) global num_species; global max_alive_cell_index; global species_names; global external_species_names; global REC_SPECIES; global EXTERNAL_REC_SPECIES; global REC_time; global curr_time; global num_external_species; % % Plot each species for each cell % subplot_x = ceil(sqrt(num_species)); subplot_y = ceil(sqrt(num_species)); while (((subplot_x * subplot_y)-subplot_y) > num_species) subplot_y = subplot_y - 1; end for c=1:min(max_alive_cell_index,num_cells_to_plot) figure(100+c); for s=1:num_species subplot(subplot_x,subplot_y,s); plot(squeeze(REC_time(1:floor(curr_time))), ... squeeze(REC_SPECIES(c,s,1:floor(curr_time)))); hold on; ht=title(species_names{s}); set(ht,'Interpreter','none'); hold off; end end % % Plot external species % subplot_x = ceil(sqrt(num_external_species)); subplot_y = ceil(sqrt(num_external_species)); while (((subplot_x * subplot_y)-subplot_y) > num_species) subplot_y = subplot_y - 1; end figure(100); for e=1:num_external_species; subplot(subplot_x,subplot_y,e); plot(squeeze(REC_time(1:floor(curr_time))), ... squeeze(EXTERNAL_REC_SPECIES(e,1:floor(curr_time)))); hold on; ht=title(external_species_names{e}); set(ht,'Interpreter','none'); hold off; end