Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Thresholding

Subject: Thresholding

From: Thomas Bunn

Date: 5 Apr, 2013 03:44:07

Message: 1 of 3

What is the MatLab function for the following routine?

        for n=1:N+1
            for m=1:N+1
                if F(n,m)>Thresh;
                    F(n,m)=F(n,m) - Thresh;
                else
                    F(n,m)=0;
                end
            end
        end

Thanks for the tip.

Subject: Thresholding

From: Nasser M. Abbasi

Date: 5 Apr, 2013 03:50:27

Message: 2 of 3

On 4/4/2013 10:44 PM, Thomas Bunn wrote:
> What is the MatLab function for the following routine?
>
> for n=1:N+1
> for m=1:N+1
> if F(n,m)>Thresh;
> F(n,m)=F(n,m) - Thresh;
> else
> F(n,m)=0;
> end
> end
> end
>
> Thanks for the tip.
>

EDU>> F=rand(5);
F =
     0.8147 0.0975 0.1576 0.1419 0.6557
     0.9058 0.2785 0.9706 0.4218 0.0357
     0.1270 0.5469 0.9572 0.9157 0.8491
     0.9134 0.9575 0.4854 0.7922 0.9340
     0.6324 0.9649 0.8003 0.9595 0.6787

EDU>> thresh=.5;
EDU>> F(F<thresh)=0

     0.8147 0 0 0 0.6557
     0.9058 0 0.9706 0 0
          0 0.5469 0.9572 0.9157 0.8491
     0.9134 0.9575 0 0.7922 0.9340
     0.6324 0.9649 0.8003 0.9595 0.6787

EDU>> F(F>=thresh)=F(F>=thresh)-thresh

     0.3147 0 0 0 0.1557
     0.4058 0 0.4706 0 0
          0 0.0469 0.4572 0.4157 0.3491
     0.4134 0.4575 0 0.2922 0.4340
     0.1324 0.4649 0.3003 0.4595 0.1787

Subject: Thresholding

From: Thomas Bunn

Date: 5 Apr, 2013 03:56:07

Message: 3 of 3

"Nasser M. Abbasi" wrote in message <kjlhm3$bak$1@speranza.aioe.org>...
> On 4/4/2013 10:44 PM, Thomas Bunn wrote:
> > What is the MatLab function for the following routine?
> >
> > for n=1:N+1
> > for m=1:N+1
> > if F(n,m)>Thresh;
> > F(n,m)=F(n,m) - Thresh;
> > else
> > F(n,m)=0;
> > end
> > end
> > end
> >
> > Thanks for the tip.
> >
>
> EDU>> F=rand(5);
> F =
> 0.8147 0.0975 0.1576 0.1419 0.6557
> 0.9058 0.2785 0.9706 0.4218 0.0357
> 0.1270 0.5469 0.9572 0.9157 0.8491
> 0.9134 0.9575 0.4854 0.7922 0.9340
> 0.6324 0.9649 0.8003 0.9595 0.6787
>
> EDU>> thresh=.5;
> EDU>> F(F<thresh)=0
>
> 0.8147 0 0 0 0.6557
> 0.9058 0 0.9706 0 0
> 0 0.5469 0.9572 0.9157 0.8491
> 0.9134 0.9575 0 0.7922 0.9340
> 0.6324 0.9649 0.8003 0.9595 0.6787
>
> EDU>> F(F>=thresh)=F(F>=thresh)-thresh
>
> 0.3147 0 0 0 0.1557
> 0.4058 0 0.4706 0 0
> 0 0.0469 0.4572 0.4157 0.3491
> 0.4134 0.4575 0 0.2922 0.4340
> 0.1324 0.4649 0.3003 0.4595 0.1787

THANK-YOU

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us