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