Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Random for basic artihmetic operations
Date: Tue, 26 May 2009 12:25:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <gvgn2v$j2h$1@fred.mathworks.com>
References: <4a15cb07$0$31332$9b4e6d93@newsspool4.arcor-online.net> <gv50pd$ib3$1@fred.mathworks.com> <4a1b0740$0$30229$9b4e6d93@newsspool1.arcor-online.net> <gvf4q5$o56$1@fred.mathworks.com> <4a1bda3a$0$31337$9b4e6d93@newsspool4.arcor-online.net>
Reply-To: "Sadik " <sadik.hava@gmail.com>
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 1243340703 19537 172.30.248.38 (26 May 2009 12:25:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 26 May 2009 12:25:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:542575


It means, we are looking for the indices of opDraw for which opDraw = 0 and then replacing those zeroes with 1s because we cannot use a zero for indexing. 

For example, if you have a vector x = [1 2 3 4 5 3 4]; and you would like to change 3s into 7s, then you say:

x(x==3)=7;

so that you now have x = [1 2 7 4 5 7 4].

Hope this helps.


"Sven Schulz" <sven-schu@arcor.de> wrote in message <4a1bda3a$0$31337$9b4e6d93@newsspool4.arcor-online.net>...
> Hi,
> 
> thank you, it works.
> 
> What is the meaning of this line?
> 
> opDraw(opDraw==0)=1; %If there are any zeroes, they should be 1.
> 
> Sven