frequency.m
Upload User: mgf822
Upload Date: 2022-06-06
Package Size: 51k
Code Size: 0k
Development Platform:

Matlab

  1. function f=frequency(vector)
  2. %         if ~isa(vecor,'uint8')
  3. %             error('input argument must be a uint8 vector');
  4. %         end
  5.         f=repmat(0,1,256);
  6.         len=length(vector);
  7.         for index=0:255
  8.             f(index+1)=sum(vector==uint8(index));
  9.         end
  10.         f=f./len;