function x = bracketing(a, b, n)
    % Bracketing function to create a linearly spaced array
    % Inputs:
    %   a - Lower bound of the interval
    %   b - Upper bound of the interval
    %   n - Number of points in the interval
    % Output:
    %   x - Array of linearly spaced points between a and b
    
    % Input validation
    if nargin < 3
        error('Not enough input arguments. Provide a, b, and n.');
    end
    
    % Ensure n is a positive integer
    if n <= 0 || mod(n, 1) ~= 0
        error('The number of points n must be a positive integer.');
    end
    
    % Generate the linearly spaced array
    x = linspace(a, b, n);
end


    % Ensure n is a positive integer greater than 1
    if n < 2 || floor(n) ~= n
        error('The number of points, n, must be an integer greater than or equal to 2.');
    end

    % Generate linearly spaced points
    x = linspace(a, b, n);

    % Display the result for user reference
    fprintf('Generated %d linearly spaced points between %.2f and %.2f:\n', n, a, b);
    disp(x);

    % Ensure n is a positive integer
    if n <= 0 || mod(n, 1) ~= 0
        error('The number of points n must be a positive integer.');
    end
    
    % Generate the linearly spaced array
    x = linspace(a, b, n)
