mep: a pedestrian vector index list creator

Versione 1.0.0.0 (2,17 KB) da us
Creates epochs (0|1) in a logical array according to a list of indices (begin:end).
6,5K download
Aggiornato 21 mag 2003

Visualizza la licenza

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)='+'
% ++++-+++--

Cita come

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. Recuperato .

Compatibilità della release di MATLAB
Creato con R13
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Matrix Indexing in Help Center e MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0

enhanced help