Table of contents
CSPICE_WNCARD returns the cardinality (number of intervals) of a
double precision window.
Given:
window SPICE window containing zero or more intervals.
[2n,1] = size(window); double = class(window)
the call:
[wncard] = cspice_wncard( window )
returns:
wncard the cardinality (number of intervals) of the input `window'.
[1,1] = size(wncard); int32 = class(wncard)
None.
Any numerical results shown for this example may differ between
platforms as the results depend on the SPICE kernels used as input
and the machine specific arithmetic implementation.
1) Given a double precision window, determine its cardinality
(number of intervals).
Example code begins here.
function wncard_ex1()
%
% Define a window with three intervals (six values).
%
window = [ [ 1.; 3.]; [ 7.; 11.]; [23.; 27.] ];
%
% What's the window cardinality of `window'?
%
card = cspice_wncard(window);
%
% Print the window cardinality (this ought to show "3" ).
%
fprintf('Number of intervals in the window: %d\n', card )
When this program was executed on a Mac/Intel/Octave6.x/64-bit
platform, the output was:
Number of intervals in the window: 3
This function returns the value numel(window)/2.
1) If the number of elements in `window' is not even, the error
SPICE(INVALIDSIZE) is signaled by a routine in the call tree
of this routine.
2) If the input argument `window' is undefined, an error is
signaled by the Matlab error handling system.
3) If the input argument `window' is not of the expected type, or
it does not have the expected dimensions and size, an error is
signaled by the Mice interface.
None.
None.
MICE.REQ
WINDOWS.REQ
None.
J. Diaz del Rio (ODC Space)
S.C. Krening (JPL)
E.D. Wright (JPL)
-Mice Version 1.1.0, 10-AUG-2021 (EDW) (JDR)
Edited the header to comply with NAIF standard. Added
example's problem statement.
Changed output argument name "card" to "wncard" to comply with
NAIF standard.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
Eliminated use of "lasterror" in rethrow.
Removed reference to the function's corresponding CSPICE header from
-Required_Reading section.
-Mice Version 1.0.1, 12-MAR-2012 (EDW) (SCK)
Edited -I/O section to conform to NAIF standard for Mice
documentation.
-Mice Version 1.0.0, 30-DEC-2008 (EDW)
cardinality of a d.p. window
|