ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
logrange.m File Reference

Go to the source code of this file.

Functions

function logrange (in start, in stop, in sizemax)
 Return a set of maximum sizemax unique integer spacings almost linearly spaced in the natural logarithmic scale between the specified start and stop of the output range. More...
 

Function Documentation

◆ logrange()

function logrange ( in  start,
in  stop,
in  sizemax 
)

Return a set of maximum sizemax unique integer spacings almost linearly spaced in the natural logarithmic scale between the specified start and stop of the output range.

Parameters
[in]start: The input scalar MATLAB whole-number (integer) representing the starting point of the output range.
[in]stop: The input scalar MATLAB whole-number (integer) representing the stopping point of the output range.
[in]sizemax: The input scalar MATLAB whole-number (integer) representing the maximum size of the output range.
Due to rounding operation involved in creating the output range, it is impossible to prespecify the output range size, only the maximum.
(optional, default = 100)
Returns
array : The output vector of MATLAB real values containing the set of naturally logarithmically-spaced integer values in the specified input range.


Possible calling interfaces

array = pm.array.logrange(start, stop)
array = pm.array.logrange(start, stop, [])
array = pm.array.logrange(start, stop, sizemax)


Example usage

1cd(fileparts(mfilename('fullpath'))); % Change working directory to source code directory.
2addpath('../../../'); % Add the ParaMonte library root directory to the search path.
3
4assert(all(pm.array.logrange(1, 1000, 10) == [1, 2, 4, 8, 16, 32, 63, 126, 251, 501, 1000]));
5assert(all(pm.array.logrange(1, 1000, 20) == [1, 2, 3, 4, 6, 8, 11, 16, 22, 32, 45, 63, 89, 126, 178, 251, 355, 501, 708, 1000]));
6pm.array.logrange(1, 1000, [])
7pm.array.logrange(1, 100)
function root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.

Example output
1ans =
2 Columns 1 through 6
3 1 2 3 4 5 6
4 Columns 7 through 12
5 7 8 9 10 11 12
6 Columns 13 through 18
7 13 14 15 16 17 18
8 Columns 19 through 24
9 19 21 22 24 26 28
10 Columns 25 through 30
11 30 32 34 36 39 42
12 Columns 31 through 36
13 45 48 51 55 59 63
14 Columns 37 through 42
15 68 72 78 83 89 95
16 Columns 43 through 48
17 102 110 117 126 135 145
18 Columns 49 through 54
19 155 166 178 191 204 219
20 Columns 55 through 60
21 234 251 269 288 309 331
22 Columns 61 through 66
23 355 380 407 437 468 501
24 Columns 67 through 72
25 537 575 617 661 708 759
26 Columns 73 through 76
27 813 871 933 1000
28ans =
29 Columns 1 through 13
30 1 2 3 4 5 6 7 8 9 10 11 12 13
31 Columns 14 through 26
32 14 15 16 17 18 19 20 21 22 23 24 25 26
33 Columns 27 through 39
34 28 29 30 32 33 35 36 38 40 42 44 46 48
35 Columns 40 through 52
36 50 52 55 58 60 63 66 69 72 76 79 83 87
37 Columns 53 through 55
38 91 95 100


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 4:29 PM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin