-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsaveIonoGrid.m
33 lines (27 loc) · 969 Bytes
/
saveIonoGrid.m
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
function saveIonoGrid(iono_struct, general_struct)
date = general_struct.UT;
date(6) = 0;
time = general_struct.UT(4);
dateFile = datestr(date, 'dd-mmmm-yyyy');
myFolder = ['dat'];
dateFolder = fullfile(myFolder, dateFile);
if ~isdir(myFolder)
[status, msg, msgID] = mkdir('dat');
if ~status
msg
return
end
end
if ~isdir(dateFolder)
[status, msg, msgID] = mkdir(strrep('dat/dateFile', 'dateFile', dateFile));
if ~status
msg
return
end
end
iono_string = strrep('iono_grid-TIMEUT-test.mat', 'TIME', num2str(time));
iono_path = fullfile(dateFolder, iono_string);
gen_string = strrep('gen_struct-TIMEUT-test.mat', 'TIME', num2str(time));
gen_path = fullfile(dateFolder, gen_string);
save(gen_path, '-struct', 'general_struct')
save(iono_path, '-struct', 'iono_struct')