I want to calculate c with this exemple.
    24 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    albert Kinda
 el 5 de Oct. de 2025 a las 8:16
  
    
    
    
    
    Comentada: Mathieu NOE
      
 el 6 de Oct. de 2025 a las 8:50
            clc
clear all;  
close all;
% The latitude of the location.
lat=input('Give lattitudelta du lieu');
for i=1:1:12
    %DECLINATION
    Days=[17 47 75 105 135 162 198 228 258 288 318 344];
    delta(i)=23.45*(pi/180)*sin(pi/180*(284+Nj(i))*360/365)
    phir=lat*ones(1,12)*pi/180
%     sunrise and sunset time calculation
    du(i)=(2/15)*(180/pi)*acos((-tan(delta(i))).*(tan(phir(i))) );
    dur(i)=(24/pi)*du(i);
    sunrise(i)=12-180/pi*acos(-tan(phir(i))*tan(delta(i)))/15;
    sunset(i)=12+180/pi*acos(-tan(phir(i))*tan(delta(i)))/15;
    c=sunrise(i):0.5:sunset(i)
end
C is a matrix that contains for each day a vector that goes from sunrise to sunset with a step of 0.5. as illustrated in the figure below 

2 comentarios
  Torsten
      
      
 el 5 de Oct. de 2025 a las 10:59
				Is 
sunset(i) - sunrise(i) 
equal for all i and an integer number ? If not, C cannot be generated.
  Mathieu NOE
      
 el 6 de Oct. de 2025 a las 8:50
				Unrecognized function or variable 'Nj'.
    delta(i)=23.45*(pi/180)*sin(pi/180*(284+Nj(i))*360/365)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Respuestas (0)
Ver también
Categorías
				Más información sobre Gravitation, Cosmology & Astrophysics en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


