-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave_t.m
More file actions
47 lines (45 loc) · 1.88 KB
/
save_t.m
File metadata and controls
47 lines (45 loc) · 1.88 KB
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
function save_t( name, var, fmt )
% This file is part of GPCCA.
%
% Copyright (c) 2018, 2017 Bernhard Reuter
%
% If you use this code or parts of it, cite the following reference:
%
% Reuter, B., Weber, M., Fackeldey, K., Röblitz, S., & Garcia, M. E. (2018). Generalized
% Markov State Modeling Method for Nonequilibrium Biomolecular Dynamics: Exemplified on
% Amyloid β Conformational Dynamics Driven by an Oscillating Electric Field. Journal of
% Chemical Theory and Computation, 14(7), 3579–3594. https://doi.org/10.1021/acs.jctc.8b00079
%
% GPCCA is free software: you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as published
% by the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU Lesser General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
% -------------------------------------------------------------------------
% flexible wrapper function to unify save with different numeric types
% syntax is basically like in normal matlab save()
%
% save_t( name, var, fmt )
%
% Input:
% name string containing the filename with ending i.e. 'dummy.txt'
% var variable to be saved i.e. T (NOT in quotes!)
% fmt format specifier i.e. '-ascii'
%
% Written by Bernhard Reuter, Theoretical Physics II,
% University of Kassel, 2017
class_t = class(var) ;
if (strcmpi(class_t,'mp'))
mp.write(var,name)
else
precision = strcat('-',class_t) ;
save(name,'var',fmt,precision)
end
end