get_meteo.m
886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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