% Define the precomp path precomp_path = "C:\Users\sioe\Documents\MATLAB\imdd_simulation\projects\ECOC_2025\"; % Step 1: Find all valid files (assume .mat files for ChannelFreqResp) fileList = dir(fullfile(precomp_path, '*.mat')); fileNames = {fileList.name}; % Check if any files found if isempty(fileNames) error('No valid .mat files found in the specified folder.'); end % Step 2: Let user select which files to plot [selection, ok] = listdlg( ... 'PromptString', 'Select Transfer Functions to Plot:', ... 'SelectionMode', 'multiple', ... 'ListString', fileNames); % Check if user pressed OK if ~ok || isempty(selection) disp('No files selected. Exiting.'); return; end % Step 3: Loop over selected files and plot for idx = selection precomp_filename = erase(fileNames{idx}, '.mat'); % Remove .mat extension freqresp = ChannelFreqResp("Nacq",1024,"Navg",64,"Ncp",63,'f_ref',92e9); freqresp.load('loadPath', precomp_path, 'fileName', precomp_filename); fprintf('Plotting: %s\n', precomp_filename); freqresp.plot(); end