Hello, 
How to plot the figure SNR vs Amplitude for each ECG Lead separately:
%----available amplitudes
amplitudes = {'0.05', '0.10', '0.15', '0.20', '0.25', '0.30', '0.35',...
              '0.40', '0.45', '0.50', '1.00', '1.50',  '2.00', '2.50', '3.00',...
              '3.50', '4.00', '4.50', '5.00', '5.50' }
%heartRates =  {'30bpm', '40bpm', '45bpm', '60bpm', '80bpm', '90bpm', '100bpm'}
              
%heartRates = {'120bpm', '140bpm', '160bpm', '180bpm', '200bpm', '220bpm',...
 %            '240bpm', '260bpm', '280bpm', '300bpm'}
Fs = 1000;
s = struct;
% Build table
T = table();
SNR = {}
     Leads = ["I" "II" "V_"+(1:6)];
     ECGLeads = {ecgData.leadI, ecgData.leadII,...
                 ecgData.V1, ecgData.V2, ecgData.V3,...
                 ecgData.V4, ecgData.V5, ecgData.V6};
    %----get amplitude/heart rate parameter from text file
    file = fullFileName
    field=textread(file,'%s',7,'delimiter','\n')
    
    %-------for each amplitude parameters
     for kleads = 1:length(ECGLeads)            
            for iamp = 1:length(amplitudes)
               if (find(~cellfun(@isempty,strfind(field,amplitudes{iamp}))==true))
                % Define parameters
                total_samples = size(rawData,1);
                sampling_frequency = 1000; % in Hz
                duration = 3; % in seconds
                
                % Generate a time vector for the entire signal
                t = (0:total_samples-1) / sampling_frequency;
                
                % Generate a e sigsamplnal (for example, a sine wave)
                signal = ECGLeads{kleads}; % 
                
                % Extract sample of signal
                sample_duration = duration; % in seconds
                sample_samples = sample_duration * sampling_frequency;
                sample_signal = signal(1:sample_samples);
                sample_time = t(1:sample_samples);
                sample_ecg{kleads} = sample_signal;
                %s.(amplitudes{iamp}).(sample_ecg{kleads}) = sample_signal;
                %calculate snr
                SNR{iamp} = calc_snr(sample_ecg{kleads}, Fs)          
        end%iamp 
      end%if
            tiledlayout(2, 4, TileIndexing='columnmajor')
            for iamp = 1:length(amplitudes)
                % snr_Min = min(cell2mat(SNR{:}));
                % snr_Max= min(cell2mat(SNR));
                % sample_snr;
                sample_amplitude = vertcat(amplitudes{:});
                nexttile
                plot(amplitudes, SNR{iamp});
                xlabel('Amplitude (mV)');
                ylabel('SNR (dB)');
                title(Leads{kleads}, [amplitudes, SNR ]);
                % xlim([0 3])
                % %ylim([-4.5e-03 50e-04])
                % ylim([snr_Min snr_Max])
                output_fig_snr = [path_data_fig, Leads{kleads},'.fig']
                output_fig_snr_jpg = [path_data_fig, Leads{kleads},'.jpg']
                saveas(gcf, output_fig_snr, 'fig')
                saveas(gcf, output_fig_snr_jpg, 'jpg')
            end %iamp
        end %if amp 
        end %kleads