I have a matrix of order nXm, I want to find frequency of each number and corresponding co-ordinates.

I have a matrix M, for example M=[0 0 9 0 0 0 0 0;0 0 0 5 10 0 0 0;0 12 6 0 0 10 0 8;0 0 8 5 6 0 6 0]; I have divided it into boxes of size 2 X 2 then find the number of nonzero numbers and their sum in each box as
img=blkproc(B,[2 2],'length(find(B>=1))');
img1=blkproc(B,[2 2],'sum(sum(B))');
now I have to find frequencies of each number in img and corresponding co-ordinates. as I have to collect them separately. so that corresponding to each i in img, I can have corresponding value in img1. so, for each i, I can have a new array w(i)=average value of i points.
Please try to help me if possible. thanks and regards Kunti Mishra

Answers (0)

This question is closed.

Asked:

on 17 Nov 2014

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!