0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 
0012 
0013 
0014 
0015 
0016 
0017 
0018 
0019 
0020 
0021 
0022 
0023 
0024 function x = glinspace(d1,d2,gamma,n)
0025 
0026 
0027 if nargin < 3,
0028   error('Incorrect number of parameters (type ''help <a href="matlab:help glinspace">glinspace</a>'' for details).');
0029 end
0030 
0031 
0032 if ~isdscalar(d1),
0033   error('Incorrect start value (type ''help <a href="matlab:help glinspace">glinspace</a>'' for details).');
0034 end
0035 if ~isdscalar(d2),
0036   error('Incorrect stop value (type ''help <a href="matlab:help glinspace">glinspace</a>'' for details).');
0037 end
0038 if ~isdscalar(gamma) || gamma <= 0,
0039   error('Incorrect start value (type ''help <a href="matlab:help glinspace">glinspace</a>'' for details).');
0040 end
0041 if nargin < 3,
0042     n = 100;
0043 end
0044 if ~isiscalar(n),
0045   error('Incorrect number of values (type ''help <a href="matlab:help glinspace">glinspace</a>'' for details).');
0046 end
0047 
0048 if d1 > d2
0049     gamma = 1/gamma;
0050 end
0051 
0052 x = linspace(0,1,n) .^ (1/gamma);
0053 x = x *(d2-d1) + d1;