Path: news.mathworks.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!gegeweb.org!aioe.org!.POSTED!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: matlab refuse to set matrix values to 0
Date: Wed, 11 Jan 2012 12:12:28 -0600
Organization: Aioe.org NNTP Server
Lines: 27
Message-ID: <jekjeb$rh4$1@speranza.aioe.org>
References: <jefpag$841$1@newscl01ah.mathworks.com> <jefrus$g1s$1@newscl01ah.mathworks.com> <jeh0mh$1l4$1@newscl01ah.mathworks.com> <jei5r8$7ar$1@newscl01ah.mathworks.com> <jejpf4$asg$1@newscl01ah.mathworks.com> <jek45v$lkn$1@speranza.aioe.org> <jekas0$97h$1@newscl01ah.mathworks.com> <jekbhb$7qs$1@speranza.aioe.org> <jeke6s$l1a$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: pnkWxi+WOEB8wZs84ZuEBg.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
X-Notice: Filtered by postfilter v. 0.8.2
Xref: news.mathworks.com comp.soft-sys.matlab:754455

On 1/11/2012 10:43 AM, besbesmany besbesmany wrote:
...

> the problem that i update matrix from 1:m with iterations so m is
> differe from loop to another when i use your code
> A(A(1:m,1:col)<0)=0;
> it give me error
> like this where m=4 for certain loop
> A=rand(5)
> A(A(1:4,1:5)>0.5)=0
> it give me wrong indexs becomes 0
...

I have no clue what you're driving at...

We need a _complete_ (but short) example that demonstrates what you find 
to be a wrong index.  So far, I've not seen anything that makes me think 
that

 > A=rand(5)
 > A(A(1:4,1:5)>0.5)=0
 > it give me wrong indexs becomes 0

Show the modification in the loop; so far there's been nothing shown but 
a static array.

--