filename = 'Book1.xlsx';
cols2to4 = xlsread(filename,'B:D');
n = cols2to4(:, 1);
hour_angle = cols2to4(:, 3);
lat = 40;
slope = 32;
azimuth_angle=0;
declination= 23.45 * sind(360 / 365 * (284+n));
cos_angleofincidence = sind(declination) .* sind(lat) .* cosd(slope) - ...
sind(declination) .* cosd(lat) .* sind(slope) .* cosd(azimuth_angle) + ...
cosd(declination) .* cosd(lat) .* cosd(slope) .* cosd(hour_angle)+...
cosd(declination) .* sind(lat) .* sind(slope) .* cosd(azimuth_angle) .* cosd(hour_angle)+...
cosd(declination) .* sind(slope) .* sind(hour_angle);
cos_zenithangle=cosd(lat) .* cosd(declination) .* cosd(hour_angle)+sind(lat) .* sind(declination);
Rb = cos_angleofincidence ./ cos_zenithangle
Rb(isinf(Rb)) = 0;
plot(Rb, 'b-');
numerator=cos_angleofincidence(end)
denominator=cos_zenithangle(end)
lastRatio=cos_angleofincidence(end)./cos_zenithangle(end)
Best Answer