Hi Abdallah,
To calculate the zenith angle using the Solar Position and Algorithm (SPA) for each time step in a 24-hour period, you'll need to loop through each time step, input the necessary parameters into the SPA function, and store the results. 
Below is a self explanatory code snippet on how to achieve this:
% Define constants, latitude, longitude, elevation, slope, timezone
time_steps = 0:1/24:23/24; % 24-hour period with hourly steps
% Array for zenith angles
zenith_angles = zeros(length(time_steps), 1);
% Loop over each time step
for i = 1:length(time_steps)
    % Get current time step
    current_time = time_steps(i);
    % Calculate date and time components
    hour = floor(current_time * 24);
    minute = mod(current_time * 1440, 60);
    second = 0;
    % Call SPA function (assuming you have a function 'spa_calculate')
    spa_results = spa_calculate(year, month, day, hour, minute, second, ...
                                latitude, longitude, elevation, slope, timezone);
    % Extract zenith angle from results
    zenith_angles(i) = spa_results.zenith;
end
Hope this helps!


