forked from chebfun/chebfun
-
Notifications
You must be signed in to change notification settings - Fork 1
/
chebfuneps.m
39 lines (36 loc) · 1.33 KB
/
chebfuneps.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
34
35
36
37
38
39
function varargout = chebfuneps(val)
%CHEBFUNEPS Set the default value of the chebfuneps preference.
% CHEBFUNEPS VAL, or CHEBFUNEPS(VAL) sets the default value of the
% chebfuneps preference to the specified value VAL. CHEBFUNEPS(VAL) is
% equivalent to CHEBFUNPREF.SETDEFAULTS('chebfuneps', VAL).
%
% CHEBFUNEPS factory, or CHEBFUNEPS('factory') sets the default
% chebfuneps preference to the factory value. This is equivalent to
% chebfunpref.setDefaults('chebfuneps', 'factory').
%
% CHEBFUNEPS prints the current default value of the chebfuneps
% preference.
%
% If changing the preference is needed only for a single construction,
% calling constructor with the 'eps' flag is a better option.
%
% See also CHEBFUN2EPS.
% Copyright 2017 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.
if ( nargin == 0 )
% Return current chebfuneps:
varargout{1} = chebfunpref().techPrefs.chebfuneps;
else
if ( strcmpi(val, 'factory') )
chebfunpref.setDefaults('chebfuneps', 'factory');
else
eval(['val=',val,';'])
if ( isnumeric(val) )
chebfunpref.setDefaults('chebfuneps', val);
else
error('CHEBFUN:chebfuneps:unknownOption',...
'Unknown CHEBFUNEPS option.')
end
end
end
end