Path: news.mathworks.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed-0.progon.net!progon.net!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail
From: "Sven Schulz" <sven-schu@arcor.de>
Newsgroups: comp.soft-sys.matlab
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> <gvgn2v$j2h$1@fred.mathworks.com>
Subject: Re: Random for basic artihmetic operations
Date: Thu, 28 May 2009 23:06:04 +0200
MIME-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="iso-8859-1";
	reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Lines: 21
Message-ID: <4a1efcc0$0$30227$9b4e6d93@newsspool1.arcor-online.net>
Organization: Arcor
NNTP-Posting-Date: 28 May 2009 23:06:08 CEST
NNTP-Posting-Host: a9b7419f.newsspool1.arcor-online.net
X-Trace: DXC=8PZkJ1RC`N3nBOkdL^Lo7>ic==]BZ:af>4Fo<]lROoR1^YC2XCjHcb9ZLT6fAm5;E9GMLZV>W<eM8QV^GiW:JVo7a[e>f_R>5Z0Q;]:\2XC\B5
X-Complaints-To: usenet-abuse@arcor.de
Xref: news.mathworks.com comp.soft-sys.matlab:543380


Sadik  wrote:
> 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.

Yes, i understand.

This is a verry cool procedure to replace a number in a vector. I would 
use a for-next-loop with if-else . . .

Sven