• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
مهمان عزیز خوش‌آمدید. ورود عضــویت


امتیاز موضوع:
  • 36 رای - 2.56 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
Title: سورس کد هیستوگرام در متلب
حالت خطی
#1
کد:
function [result,descriptor]=histogram(x,descriptor)
%HISTOGRAM Computes the frequency histogram of the row vector x.
%   [RESULT,DESCRIPTOR] = HISTOGRAM(X) or
%   [RESULT,DESCRIPTOR] = HISTOGRAM(X,DESCRIPTOR) or
%where
%   DESCRIPTOR = [LOWER,UPPER,NCELL]
%
%   RESULT    : A row vector containing the histogram
%   DESCRIPTOR: The used descriptor
%
%   X         : The row vector be analyzed
%   DESCRIPTOR: The descriptor of the histogram
%     LOWER   : The lowerbound of the histogram
%     UPPER   : The upperbound of the histogram
%     NCELL   : The number of cells of the histogram
%
%   See also: http://www.cs.rug.nl/~rudy/matlab/

%   R. Moddemeijer
%   Copyright (c) by R. Moddemeijer
%   $Revision: 1.2 $  $Date: 2001/02/05 09:54:29 $


if nargin <1
   disp('Usage: RESULT = HISTOGRAM(X)')
   disp('       RESULT = HISTOGRAM(X,DESCRIPTOR)')
   disp('Where: DESCRIPTOR = [LOWER,UPPER,NCELL]')
   return
end

% Some initial tests on the input arguments

[NRowX,NColX]=size(x);

if NRowX~=1
  error('Invalid dimension of X');
end;

if nargin>2
  error('Too many arguments');
end;

if nargin==1
  minx=min(x);
  maxx=max(x);
  delta=(maxx-minx)/(length(x)-1);
  ncell=ceil(sqrt(length(x)));
  descriptor=[minx-delta/2,maxx+delta/2,ncell];
end;

lower=descriptor(1);
upper=descriptor(2);
ncell=descriptor(3);

if ncell<1
  error('Invalid number of cells')
end;

if upper<=lower
  error('Invalid bounds')
end;

result(1:ncell)=0;

y=round( (x-lower)/(upper-lower)*ncell + 1/2 );
for n=1:NColX
  index=y(n);
  if index >= 1 & index<=ncell
    result(index)=result(index)+1;
  end;
end;
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
 
پاسخ
  


پیام‌های این موضوع
سورس کد هیستوگرام در متلب - توسط Amin_Mansouri - 02-26-2012، 11:26 AM
RE: سورس کد هیستوگرام در متلب - توسط thania - 04-06-2012، 06:08 PM
RE: سورس کد هیستوگرام در متلب - توسط neno - 04-08-2014، 09:16 AM

موضوعات مشابه ...
موضوع نویسنده پاسخ بازدید آخرین ارسال
  متلب چیست؟ Amin_Mansouri 2 7,668 07-10-2017، 03:34 PM
آخرین ارسال: shivanno18
  سورس NAND Checker Amin_Mansouri 1 3,882 07-10-2017، 03:33 PM
آخرین ارسال: shivanno18
  حل اين مسئله در متلب (هيستوگرام) adel28 0 2,202 06-29-2016، 10:57 AM
آخرین ارسال: adel28
  مجموعه سورس کد پردازش تصاویر ( متلب ) Amin_Mansouri 4 18,619 08-21-2015، 10:56 AM
آخرین ارسال: عبادی
  لود کردن داده های ایکسل در متلب roya8108 1 5,410 06-09-2014، 02:03 PM
آخرین ارسال: Amin_Mansouri
  سورس برنامه جاوا Sanazjoon 0 3,160 05-20-2014، 08:06 PM
آخرین ارسال: Sanazjoon
  مقاله و سورس کد شناسایی ماشین و انسان در پردازش تصاویر Amin_Mansouri 0 5,778 05-06-2013، 07:15 PM
آخرین ارسال: Amin_Mansouri
  افزایش وضوح تصویر با نرم افزار متلب taranom_0123 1 7,324 11-03-2012، 11:22 AM
آخرین ارسال: Amin_Mansouri
  زبان برنامه‌نویسی متلب Amin_Mansouri 1 6,897 10-24-2012، 02:01 PM
آخرین ارسال: mehdi_farajpour
  سورس زیر نحوه گرفتن سیگنال و کار کردن با جی پی اس (متلب) Amin_Mansouri 0 4,103 09-10-2012، 11:47 AM
آخرین ارسال: Amin_Mansouri

پرش به انجمن:


Browsing: 1 مهمان