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

Go to the source code of this file.

Functions

function logspace (in loglb, in logub, in logskip, in base)
 Return a set of unique real spacings linearly-spaced in the logarithmic scale in the input given base, between the specified lower and upper bounds. More...
 

Function Documentation

◆ logspace()

function logspace ( in  loglb,
in  logub,
in  logskip,
in  base 
)

Return a set of unique real spacings linearly-spaced in the logarithmic scale in the input given base, between the specified lower and upper bounds.

Parameters
[in]loglb: The input scalar MATLAB real containing the natural logarithm of the lower bound of the output logarithmically-linear spaced vector.
[in]logub: The input scalar MATLAB real containing the natural logarithm of the upper bound of the output logarithmically-linear spaced vector.
[in]logskip: The input scalar MATLAB real of value larger than 1 containing the natural logarithm of the spacing between the natural logarithm of the output values.
(optional, default = (logub - loglb) / 100)
[in]base: The input scalar MATLAB real containing the base of the logarithmic space.
(optional, default = exp(1))
Returns
array : The output vector of MATLAB real values containing the set of logarithmically-spaced values in the specified input range with the specified base.


Possible calling interfaces

array = pm.array.logspace(loglb, logub)
array = pm.array.logspace(loglb, logub, logskip)
array = pm.array.logspace(loglb, logub, [], base)
array = pm.array.logspace(loglb, logub, logskip, base)


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
4pm.array.logspace(log(10), log(20))
5pm.array.logspace(log(10), log(20), log(1.5)) % 10.000000000000002 15.000000000000007
6pm.array.logspace(log(10), log(20), [], 2)
7pm.array.logspace(log(10), log(20), log(1.5), 3) % 10.000000000000004 15.000000000000012
function root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.

Example output
1ans =
2 Columns 1 through 3
3 10.000000000000002 10.069555500567189 10.139594797900294
4 Columns 4 through 6
5 10.210121257071934 10.281138266560669 10.352649238413777
6 Columns 7 through 9
7 10.424657608411215 10.497166836230676 10.570180405613804
8 Columns 10 through 12
9 10.643701824533604 10.717734625362933 10.792282365044272
10 Columns 13 through 15
11 10.867348625260584 10.942937012607397 11.019051158766107
12 Columns 16 through 18
13 11.095694720678452 11.172871380722199 11.250584846888097
14 Columns 19 through 21
15 11.328838852957988 11.407637158684235 11.486983549970354
16 Columns 22 through 24
17 11.566881839052876 11.647335864684562 11.728349492318790
18 Columns 25 through 27
19 11.809926614295303 11.892071150027213 11.974787046189288
20 Columns 28 through 30
21 12.058078276907608 12.141948843950470 12.226402776920684
22 Columns 31 through 33
23 12.311444133449166 12.397076999389867 12.483305489016118
24 Columns 34 through 36
25 12.570133745218286 12.657565939702799 12.745606273192625
26 Columns 37 through 39
27 12.834258975629043 12.923528306374926 13.013418554419339
28 Columns 40 through 42
29 13.103934038583633 13.195079107728946 13.286858140965116
30 Columns 43 through 45
31 13.379275547861120 13.472335768656905 13.566043274476719
32 Columns 46 through 48
33 13.660402567543958 13.755418181397438 13.851094681109245
34 Columns 49 through 51
35 13.947436663504057 14.044448757379971 14.142135623730955
36 Columns 52 through 54
37 14.240501955970718 14.339552480158272 14.439291955224963
38 Columns 55 through 57
39 14.539725173203106 14.640856959456251 14.742692172911013
40 Columns 58 through 60
41 14.845235706290490 14.948492486349387 15.052467474110673
42 Columns 61 through 63
43 15.157165665103978 15.262592089605592 15.368751812880122
44 Columns 64 through 66
45 15.475649935423903 15.583291593209998 15.691681957935012
46 Columns 67 through 69
47 15.800826237267545 15.910729675098372 16.021397551792436
48 Columns 70 through 72
49 16.132835184442527 16.245047927124709 16.358041171155623
50 Columns 73 through 75
51 16.471820345351460 16.586390916288831 16.701758388567388
52 Columns 76 through 78
53 16.817928305074290 16.934906247250545 17.052697835359133
54 Columns 79 through 81
55 17.171308728755072 17.290744626157306 17.411011265922479
56 Columns 82 through 84
57 17.532114426320703 17.654059925813097 17.776853623331398
58 Columns 85 through 87
59 17.900501418559450 18.025009252216602 18.150383106343220
60 Columns 88 through 90
61 18.276629004588010 18.403753012497496 18.531761237807419
62 Columns 91 through 93
63 18.660659830736144 18.790454984280231 18.921152934511916
64 Columns 94 through 96
65 19.052759960878742 19.185282386505289 19.318726578496907
66 Columns 97 through 99
67 19.453098948245703 19.588405951738537 19.724654089867180
68 Columns 100 through 101
69 19.861849908740719 19.999999999999996
70ans =
71 10.000000000000002 15.000000000000007
72ans =
73 Columns 1 through 3
74 4.933409667914598 4.957169414858324 4.981043590891229
75 Columns 4 through 6
76 5.005032747114145 5.029137437282065 5.053358217816911
77 Columns 7 through 9
78 5.077695647820386 5.102150289086875 5.126722706116417
79 Columns 10 through 12
80 5.151413466127734 5.176223139071324 5.201152297642619
81 Columns 13 through 15
82 5.226201517295204 5.251371376254098 5.276662455529108
83 Columns 16 through 18
84 5.302075338928236 5.327610613071152 5.353268867402745
85 Columns 19 through 21
86 5.379050694206718 5.404956688619272 5.430987448642834
87 Columns 22 through 24
88 5.457143575159864 5.483425671946730 5.509834345687636
89 Columns 25 through 27
90 5.536370205988638 5.563033865391709 5.589825939388873
91 Columns 28 through 30
92 5.616747046436427 5.643797807969205 5.670978848414928
93 Columns 31 through 33
94 5.698290795208622 5.725734278807087 5.753309932703470
95 Columns 34 through 36
96 5.781018393441874 5.808860300632054 5.836836296964186
97 Columns 37 through 39
98 5.864947028223699 5.893193143306186 5.921575294232372
99 Columns 40 through 42
100 5.950094136163183 5.978750327414854 6.007544529474126
101 Columns 43 through 45
102 6.036477407013528 6.065549627906711 6.094761863243860
103 Columns 46 through 48
104 6.124114787347196 6.153609077786532 6.183245415394926
105 Columns 49 through 51
106 6.213024484284386 6.242946971861659 6.273013568844117
107 Columns 52 through 54
108 6.303224969275679 6.333581870542845 6.364084973390799
109 Columns 55 through 57
110 6.394734981939564 6.425532603700278 6.456478549591516
111 Columns 58 through 60
112 6.487573533955695 6.518818274575580 6.550213492690829
113 Columns 61 through 63
114 6.581759913014666 6.613458263750601 6.645309276609226
115 Columns 64 through 66
116 6.677313686825131 6.709472233173850 6.741785657988935
117 Columns 67 through 69
118 6.774254707179085 6.806880130245352 6.839662680298463
119 Columns 70 through 72
120 6.872603114076194 6.905702191960830 6.938960677996736
121 Columns 73 through 75
122 6.972379339907975 7.005958949116044 7.039700280757678
123 Columns 76 through 78
124 7.073604113702731 7.107671230572176 7.141902417756149
125 Columns 79 through 81
126 7.176298465432118 7.210860167583119 7.245588322016076
127 Columns 82 through 84
128 7.280483730380228 7.315547198185625 7.350779534821729
129 Columns 85 through 87
130 7.386181553576099 7.421754071653151 7.457497910193040
131 Columns 88 through 90
132 7.493413894290598 7.529502853014396 7.565765619425871
133 Columns 91 through 93
134 7.602203030598558 7.638815927637414 7.675605155698239
135 Columns 94 through 96
136 7.712571564007170 7.749716005880304 7.787039338743374
137 Columns 97 through 99
138 7.824542424151564 7.862226127809382 7.900091319590643
139 Columns 100 through 101
140 7.938138873558559 7.976369667985903
141ans =
142 12.549091579662001 19.591528026787028


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:33 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