/usr/share/freemat/toolbox/array/logspace.m is in freemat-data 4.0-5build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | % LOGSPACE LOGSPACE Logarithmically Spaced Vector
%
% Usage
%
% Generates a row vector with the specified number number of elements,
% with entries logarithmically spaced between two specified endpoints.
% The syntax for its use is either
%
% y = logspace(a,b,count)
%
% or, for a default count = 50,
%
% y = logspace(a,b)
%
% A third special use is when
%
% y = logspace(a,pi)
%
% where it generates points between 10^a and pi
%
% Contributed by Paulo Xavier Candeias under GPL.
function y = logspace(a,b,count)
if (nargin < 2) | (nargout > 1)
error('wrong use (see help logspace)')
elseif (nargin < 3)
count = 50;
end
if (b == pi)
b = log10(b);
end
y = 10.^(a+(b-a)/(count-1)*(0:count-1));
if isinf(y(end))
warning('logspace: upper limit too large')
end
|