Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: choosing particular elements of a matrix
Date: Tue, 10 Feb 2009 13:37:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 39
Message-ID: <gmrvtt$ee6$1@fred.mathworks.com>
References: <3ad3d647-8b4b-44f7-8a34-57874e98d155@z28g2000prd.googlegroups.com> <10bf59c3-7738-4dd1-ae69-767561be1569@k36g2000pri.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1234273021 14790 172.30.248.35 (10 Feb 2009 13:37:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 10 Feb 2009 13:37:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 791003
Xref: news.mathworks.com comp.soft-sys.matlab:517296


learner <learner388@gmail.com> wrote in message <10bf59c3-7738-4dd1-ae69-767561be1569@k36g2000pri.googlegroups.com>...
> On Feb 10, 4:58=A0pm, "David" <d...@bigcompany.com> wrote:
> > learner <learner...@gmail.com> wrote in message <3ad3d647-8b4b-44f7-8a34-=
> 57874e98d...@z28g2000prd.googlegroups.com>...
> > > Hi..!
> >
> > > I have a matrix of complex numbers, say a matrix of dimension 256x256.
> > > I also have a =A0radius,r =3D sqrt((real)^2+(img)^2))i.e the absolute
> > > value.
> >
> > > I want to set all the values of matrix from its center to the radius r
> > > equal to another higher =A0 value R. Please help.
> >
> > > Thank you
> >
> > ok, so what have you done so far?
> 
> I only have the image  matrix and r value... I am a beginner... am
> still learning ,
> but i have set all values above a threshold to a constant value for
> the entire matrix..but what i require is to set values within radius r
> to the value R.
> 
> 
> F2=3Dabs(F1);
> for i=3D1:256
>      for j=3D1:256
>           if  F2(i,j)>2600
>             F2(i,j)=3D3000;
>           end
>       end
>   end
> 
> Here F1 is a complex matrix got by finding fft of an image of size
> 256x256.
> 
>  Thanks!

ok, so add the r calculation to your loop and then when r<something set the matrix value to your R value.