Got Questions? Get Answers.
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:
count number of element on some criteria

Subject: count number of element on some criteria

From: Aron Sceidt

Date: 19 May, 2011 07:25:03

Message: 1 of 3

Is there a way to do count the number of elements after Iprops having a filled area of more than 'x' value avoiding having to for loop?

Something similar to:

[Ilabel num] = bwlabel(image_bw);
Iprops = regionprops(Ilabel,'FilledArea')
value = num;
count = sum(find(Iprops(1:end).FilledArea>=x))

Subject: count number of element on some criteria

From: Aron Sceidt

Date: 19 May, 2011 18:11:04

Message: 2 of 3

solution anyone?

"Aron Sceidt" <sigarru87@gmail.com> wrote in message <ir2gkf$p3n$1@newscl01ah.mathworks.com>...
> Is there a way to do count the number of elements after Iprops having a filled area of more than 'x' value avoiding having to for loop?
>
> Something similar to:
>
> [Ilabel num] = bwlabel(image_bw);
> Iprops = regionprops(Ilabel,'FilledArea')
> value = num;
> count = sum(find(Iprops(1:end).FilledArea>=x))

Subject: count number of element on some criteria

From: Sean de

Date: 19 May, 2011 18:39:05

Message: 3 of 3

"Aron Sceidt" <sigarru87@gmail.com> wrote in message <ir3mfo$bkg$1@newscl01ah.mathworks.com>...
> solution anyone?
>
> "Aron Sceidt" <sigarru87@gmail.com> wrote in message <ir2gkf$p3n$1@newscl01ah.mathworks.com>...
> > Is there a way to do count the number of elements after Iprops having a filled area of more than 'x' value avoiding having to for loop?
> >
> > Something similar to:
> >
> > [Ilabel num] = bwlabel(image_bw);
> > Iprops = regionprops(Ilabel,'FilledArea')
> > value = num;
> > count = sum(find(Iprops(1:end).FilledArea>=x))

count = sum([Iprops(1:end).FilledArea]>=x)

Tags for 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