ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
islenleq.m
Go to the documentation of this file.
1%> \brief
2%> Return ``true`` if and only if the input ``varval``
3%> has the specified maximum size ``maxlen``,
4%> Otherwise, return ``false``.
5%>
6%> \details
7%> This routine is primarily used within the procedures of
8%> the ParaMonte library for type introspection and verification
9%> in high-level programming languages.<br>
10%>
11%> @param[in] varval : The input value whose length is to verified to
12%> be less than or equal to the input value ``maxlen``.<br>
13%> Beware that,
14%> <ol>
15%> <li> an input scalar string has a length of ``1``.<br>
16%> <li> an input scalar value has a length of ``1``.<br>
17%> <li> the length of a non-scalar object is measured
18%> by the MATLAB intrinsic ``numel()``.<br>
19%> </ol>
20%> @param[in] maxlen : The input positive scalar MATLAB integer representing the
21%> maximum allowed size of the input value ``varval``.<br>
22%>
23%> @return
24%> ``itis`` : The output scalar MATLAB logical that is ``true`` if and only if
25%> the input ``varval`` has a length that is less than or equal to
26%> the specified maximum size ``maxlen``, otherwise, it is ``false``.<br>
27%>
28%> \interface{islenleq}
29%> \code{.m}
30%>
31%> itis = pm.introspection.islenleq(varval, maxlen)
32%>
33%> \endcode
34%>
35%> \see
36%> [pm.introspection.verify](@ref verify)<br>
37%> [pm.introspection.verified](@ref verified)<br>
38%> [pm.introspection.islenleq](@ref islenleq)<br>
39%> [pm.introspection.istype](@ref istype)<br>
40%>
41%> \example{islenleq}
42%> \include{lineno} example/introspection/islenleq/main.m
43%> \output{islenleq}
44%> \include{lineno} example/introspection/islenleq/main.out.m
45%>
46%> \final{islenleq}
47%>
48%> \author
49%> \JoshuaOsborne, May 21 2024, 5:47 PM, University of Texas at Arlington<br>
50%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
51%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
52function itis = islenleq(varval, maxlen)
53 if ischar(varval)
54 varval = string(varval);
55 end
56 itis = numel(varval) <= maxlen;
57end
function verify(in varval, in vartype, in maxlen, in varname)
Verify the type and number of elements of the input varval match the specified input vartype and maxl...
function islenleq(in varval, in maxlen)
Return true if and only if the input varval has the specified maximum size maxlen,...
function istype(in varval, in vartype)
Return true if and only if the input varval conforms with the specified input type vartype,...
function verified(in varval, in vartype, in maxlen)
Return true if and only if the input varval conforms with the specified input type vartype and maximu...