clear all close all load("Eu-152_10k 17-Jul-2024, 11_15.mat","Channel_1"); data(:,:, 1) = Channel_1; % MDA: Create a 3D array, z dimension is the source name_1 = 'Eu-152'; load("Cs137_10k 19-Jul-2024, 08_55.mat","Channel_1"); data(:,:, 2) = Channel_1; name_2 = 'Cs-137'; load("Sr-90_370kbq 22-Jul-2024, 15_34.mat","Channel_1"); data(:,:, 3) = Channel_1; name_3 = 'Sr-90'; % Defining parameters of MCA mca_bins = 2^10; % MDA: Number of bins in MCA largest_peak_amp = 0.05; % MDA: This is in V. %largest_peak_amp = max(peak_amp); x = 0:largest_peak_amp/(mca_bins-1):largest_peak_amp; clear Channel_1 for i = 1:size(data,3) % MDA: this determines the z dimension of the 3D data array name = ['name_',num2str(i)]; % MDA: This specifies the legend name peak_amp = max(data(:,:,i)); % MDA: Find the peak of each pulse % %largest_peak_amp = max(peak_amp); % MDA: This method will prevent you % %from plotting spectra from different source as they will give you a % %different maximum maximum. Better to fix this. [occur,xout] = hist(peak_amp, x); % %plot(occur); % plot against channel number % %figure; % plot(xout,occur, 'DisplayName', name); % plot against volts plot(xout,occur); % plot against volts % legend(name); hold all; clear peak_amp occur xout name end xlabel('volts') ylabel('counts') % check number of samples, sample rate, acquisition window, vertical % offset, trigger, HV, LV ???? % % %ADD THESE FEATURES % %axis labels % %save(workspace)