Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Zeros some value in array
Date: Wed, 26 Aug 2009 08:50:18 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 12
Message-ID: <h72t0a$9je$1@fred.mathworks.com>
References: <h70nah$rkk$1@fred.mathworks.com> <h70or6$ak0$1@fred.mathworks.com> <h71eqr$6rf$1@fred.mathworks.com> <h71her$1c6$1@fred.mathworks.com> <h72nds$8jl$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1251276618 9838 172.30.248.38 (26 Aug 2009 08:50:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 26 Aug 2009 08:50:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:566054


"Jaroslav "
> It does not matter, what indexes will be replaced with 0. But the number of  0 must be always same and this interval of zeros should be repeated randomly or periodically up to end of samples (in array)...

one of the solutions
- for the rand case...

     n=4;     % <- #data to replace with zeros
     v=1:10;
     ix=randperm(numel(v));
     v(ix(1:n))=0;

us