octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Array slicing in Octave


From: Hamid 2C
Subject: Re: Array slicing in Octave
Date: Sun, 15 May 2011 10:52:09 +0430

Thanks for your answer. Assignments like the one I mentioned before
invoke one of these assign functions but how can I invoke index
functions in Array.cc from the octave interpret?
Commands like the ones below does not invoke any of those index
functions. I couldn't find any command that triggers them. I just wish
to know the role of these index functions.

octave:1> b=1:10
b =

    1    2    3    4    5    6    7    8    9   10

octave:2> b(2:6)
ans =

   2   3   4   5   6


Thanks,
Hamid

>
> The rules are different for indexing and indexed assignment.  If you
> want to understand what happens with indexed assignment, set
> breakpoints in the functions
>
>  Array<T>::assign (const idx_vector& i, const Array<T>& rhs, const T& rfv)
>
>  Array<T>::assign (const idx_vector& i, const idx_vector& j,
>                    const Array<T>& rhs, const T& rfv)
>
>  Array<T>::assign (const Array<idx_vector>& ia,
>                    const Array<T>& rhs, const T& rfv)
>
> and step through them to see what they do.  The first is a special
> case for a single index, the second for two indices, and the third is
> the general case of 3 or more indices.
>
> jwe
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]