get_meteo.m 886 Bytes
clear all;
close all;

duration_sim=30;
time_step=1;
year=2008;
month=01;
first_day=1;

day=first_day;
hour=0;
 minute=0;
       sec=0;
       
      fid = fopen('meteo.dat','w'); 
       
      
      
      
      
      
for i=1:(duration_sim*24)/time_step
    hour=hour+1;
    
    if (mod(i,24)==0)
        day=day+1;
        hour=0;
       minute=0;
       sec=0;
    end
   
 if (day>30)
        month=month+1;
    end
   time=datenum(year,month,day,hour,minute,sec); 
   time=datestr(time,31);
   
windx=5;
windy=0;
pressure=1013;
temperature=15;
humidity=80;
cloud=0.5;

windx=num2str(windx);
windy=num2str(windy);
pressure=num2str(pressure);
humidity=num2str(humidity);
temperature=num2str(temperature);
cloud=num2str(cloud);
   file=strcat(time,'\t',windx,'\t',windy,'\t',pressure,'\t',temperature,'\t',humidity,'\t',cloud,'\n');
   fprintf(fid,file);
   
end