mep: a pedestrian vector index list creator

バージョン 1.0.0.0 (2.17 KB) 作成者: us
Creates epochs (0|1) in a logical array according to a list of indices (begin:end).
ダウンロード: 6.5K
更新 2003/5/21

ライセンスの表示

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

引用

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. 取得済み .

MATLAB リリースの互換性
作成: R13
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

enhanced help