mep: a pedestrian vector index list creator

Versión 1.0.0.0 (2,17 KB) por us
Creates epochs (0|1) in a logical array according to a list of indices (begin:end).
6,5K descargas
Actualizado 21 may 2003

Ver licencia

creates - completely vectorized - a logical array/vector <lvec> with epochs/intervals set to <1|TRUE> according to a list of indices of the form:
begin = [b1 b2 ... bN]
end = [e1 e2 ... eN]
where <b>s and <e>s may overlap or be included within each other.
lvec=[b1:e1 b2:e2 ... bN:eN]
itself can be used to retrieve/assign values from a numerical construct, eg,
vec(1,2,lvec)=nan;

help mep
vix = mep(v,ixb,ixe)
vix = mep(v,[ixb;ixe])
to create epochs

returns in VIX a <logical> array with epochs set to
true: ixb(1)->ixe(1) ... ixb(N)->ixe(N)
false: otherwise
correctly handles epoch overlaps/inclusions/reversals

v: vector (to size VIX, is not changed)
ixb: list of indices BEGIN epoch
ixe: list of indices END epoch

% examples
z=zeros(1,10);
vix=mep(z(1,:),[1 5],[3 10]);
z(1,vix)=1
% 1 1 1 0 1 1 1 1 1 1
z=zeros(1,10);
vix=mep(z(1,:),[2 3 2 6 9],[2 3 4 7 10]);
z(1,vix)=1
% 0 1 1 1 0 1 1 0 1 1
z='----------';
vix=mep(z,[[1 3 6];[4 4 8]]);
z(vix)='+'
% ++++-+++--

Citar como

us (2024). mep: a pedestrian vector index list creator (https://www.mathworks.com/matlabcentral/fileexchange/2479-mep-a-pedestrian-vector-index-list-creator), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R13
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Matrix Indexing en Help Center y MATLAB Answers.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0

enhanced help