% Clear all existing data and close all figures
% clear all;
close all;

% Your code to load data and create the 't' and 'signal' variables goes here...

% Determine the number of data points
num_data_points = length(t);

% Create a figure for each set of 3 signals
for i = 2:3:10
    % Create a figure for this set of signals with a specific resolution
    figure('Position', [100, 100, 1280, 720]);  % Set plot dimensions
    
    % Loop through the 3 signals in this set
    for j = 0:2
        signal_idx = i + j;  % Calculate the signal index
        
        % Get the signal data for the current column
        signal_data = signal(:, signal_idx);
        
        % Find the absolute maximum value and its index
        [max_value, max_index] = max(abs(signal_data));
        
        % Create a subplot for the current signal
        subplot(3, 1, j + 1);
        
        % Plot the signal
        plot(t, signal_data);
        xlabel('Time [s]');
        ylabel('Acceleration (g)');
        title(['Signal ' num2str(signal_idx)]);
        
        % Highlight the maximum value with a vertical line
        hold on;
        plot(t(max_index), max_value, 'ro', 'MarkerSize', 10);
        hold off;
        
        % Print the maximum value and its time index in the command window
        fprintf('Signal %d: Absolute Maximum Value = %.2f g at Time = %.2f s\n', signal_idx, max_value, t(max_index));
    end
end
