23 #if defined (HAVE_CONFIG_H) 45 error (
"%s: dimension vector DIMS must not be empty",
name);
52 if (ii == dimsv(
i) && ii >= 0)
55 error (
"%s: dimension vector DIMS must contain integers",
name);
109 int nargin = args.length ();
117 for (
int j = 0; j <
nargin - 1; j++)
120 error (
"sub2ind: subscripts must be numeric");
124 idxa(j) = args(j+1).index_vector ();
126 if (j > 0 && args(j+1).
dims () != args(1).
dims ())
127 error (
"sub2ind: all subscripts must be of the same size");
131 e.set_pos_if_unset (
nargin-1, j+1);
257 if (args.length () != 2)
271 error (
"ind2sub: Invalid index %s. %s",
e.idx ().c_str (),
272 e.details ().c_str ());
OCTINTERP_API void print_usage(void)
idx_vector index_vector(bool require_integers=false) const
identity matrix If supplied two scalar respectively For allows like xample val
void resize(int n, int fill_value=0)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
OCTAVE_EXPORT octave_value_list isnumeric
static dim_vector get_dim_vector(const octave_value &val, const char *name)
nd deftypefn *std::string name
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
idx_vector sub2ind(const dim_vector &dv, const Array< idx_vector > &idxa)
void error_with_id(const char *id, const char *fmt,...)
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
dim_vector redim(int n) const
Force certain dimensionality, preserving numel ().
N Dimensional Array with copy-on-write semantics.
Array< idx_vector > ind2sub(const dim_vector &dv, const idx_vector &idx)
charNDArray max(char d, const charNDArray &m)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).isinteger())
octave_idx_type numel(void) const
Number of elements in the array.
Vector representing the dimensions (size) of an Array.
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string