-
Notifications
You must be signed in to change notification settings - Fork 0
/
save_data_1par_dI1near0.m
32 lines (25 loc) · 1.18 KB
/
save_data_1par_dI1near0.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
function save_data_1par_dI1near0(N, par_stst, y_stst, nunst_stst, par_list, freq_list, T_list, amp_list, max_list, min_list, par_bf_hopf, y_bf_hopf)
% Note that the folders to save data are not created automatically.
% Need to create the folders manually.
% Otherwise, there will be error messages like "Invalid file identifier. Use fopen to generate a valid file identifier."
file_name_stationary = sprintf('./results/data/dI1_near0/bf_stationary.txt');
file_name_periodic = sprintf('./results/data/dI1_near0/bf_periodic.txt');
file_name_bfpt = sprintf('./results/data/dI1_near0/bf_bfpt.txt');
f_bf = fopen(file_name_stationary, 'w');
fprintf(f_bf, '%g\n', N);
for i=1:length(par_stst)
fprintf(f_bf, '%.9g %.9g %.9g\n', par_stst(i), y_stst(i), nunst_stst(i));
end
fclose(f_bf);
f_bf = fopen(file_name_bfpt, 'w');
for i=1:length(par_bf_hopf)
fprintf(f_bf, '%.9g %.9g\n', par_bf_hopf(i), y_bf_hopf(i));
end
fclose(f_bf);
f_bf = fopen(file_name_periodic, 'w');
fprintf(f_bf, '%g\n', N);
for i=1:length(par_list)
fprintf(f_bf, '%.9g %.9g %.9g %.9g %.9g %.9g\n', par_list(i), freq_list(i), T_list(i), amp_list(i), max_list(i), min_list(i));
end
fclose(f_bf);
end