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:
counting number of elements in matrix

Subject: counting number of elements in matrix

From: radhika

Date: 5 Apr, 2013 03:52:06

Message: 1 of 3

hi,
i have matrix size 256*256. i need to find the occurance of each element in matrix and want to store it in array.
for example ,In 2*2 matrix
[0 1:2 1] output should be count(0) ,ccount(1),count(2) in array
so [0 2 1]...
please anyone help me

Subject: counting number of elements in matrix

From: Nasser M. Abbasi

Date: 5 Apr, 2013 04:08:07

Message: 2 of 3

On 4/4/2013 10:52 PM, radhika wrote:
> hi,
> i have matrix size 256*256. i need to find the occurance of each element in matrix and
>want to store it in array.
> for example ,In 2*2 matrix
> [0 1:2 1] output should be count(0) ,ccount(1),count(2) in array
> so [0 2 1]...
> please anyone help me
>

help hist

Subject: counting number of elements in matrix

From: Bruno Luong

Date: 5 Apr, 2013 06:09:14

Message: 3 of 3

"radhika" wrote in message <kjlhp5$75g$1@newscl01ah.mathworks.com>...
> hi,
> i have matrix size 256*256. i need to find the occurance of each element in matrix and want to store it in array.
> for example ,In 2*2 matrix
> [0 1:2 1] output should be count(0) ,ccount(1),count(2) in array
> so [0 2 1]...
> please anyone help me

http://www.mathworks.com/matlabcentral/newsreader/view_thread/291578

Scroll down, there are three methods posted there.

Bruno

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