²é¿´: 2373  |  »Ø¸´: 3
µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû

niexianling

Í­³æ (³õÈëÎÄ̳)

[ÇóÖú] matlabÖÐstd2º¯Êý¼ÆËã¾ØÕóµÄ±ê×¼²îʱ£¬·ÖĸÊdzýÒÔÁËn-1»¹ÊÇn£¿

matlabÖÐstd2º¯Êý¼ÆËã¾ØÕóµÄ±ê×¼²îʱ£¬·ÖĸÊdzýÒÔÁËn-1»¹ÊÇn£¿
ÕâÊÇÈçÏ´úÂë
function s = std2(a)
%STD2 Standard deviation of matrix elements.
%   B = STD2(A) computes the standard deviation of the values in
%   A.
%
%   Class Support
%   -------------
%   A can be numeric or logical. B is a scalar of class double.
%
%   Example
%   -------
%       I = imread('liftingbody.png');
%       val = std2(I)
%
%   See also CORR2, MEAN2, MEAN, STD.

%   Copyright 1992-2010 The MathWorks, Inc.
%   $Revision: 5.19.4.6 $  $Date: 2010/09/13 16:14:04 $

% validate that our input is valid for the IMHIST optimization
fast_data_type = isa(a,'logical') || isa(a,'int8') || isa(a,'uint8') || ...
    isa(a,'uint16') || isa(a,'int16');

% only use IMHIST for images of sufficient size
big_enough = numel(a) > 300000;

if fast_data_type && isequal(ndims(a),2) && ~issparse(a) && big_enough
   
    % compute histogram
    if islogical(a)
        num_bins = 2;
    else
        data_type = class(a);
        num_bins = double(intmax(data_type)) - double(intmin(data_type)) + 1;
    end
    [bin_counts bin_values] = imhist(a, num_bins);

    % compute standard deviation
    total_pixels = numel(a);
   
    sum_of_pixels = sum(bin_counts .* bin_values);
    mean_pixel = sum_of_pixels / total_pixels;
   
    bin_value_offsets      = bin_values - mean_pixel;
    bin_value_offsets_sqrd = bin_value_offsets .^ 2;
   
    offset_summation = sum( bin_counts .* bin_value_offsets_sqrd);
    s = sqrt(offset_summation / total_pixels);
   
else
   
    % use simple implementation
    if ~isa(a,'double')
        a = double(a);
    end
    s = std(a();
   
end
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

do
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

somomo91

ר¼Ò¹ËÎÊ (Ö°Òµ×÷¼Ò)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
niexianling: ½ð±Ò+30, ¡ïÓаïÖú, лл£¬ÎÒÖªµÀÁË 2013-06-27 20:49:12
csgt0: ½ð±Ò+1, лл 2013-06-28 11:33:11
ÒýÓûØÌû:
3Â¥: Originally posted by niexianling at 2013-06-27 11:00:36
ÎÒÏëÖªµÀµÄÊÇstd2º¯Êý...

Óöµ½¹ýÕâ¸öÎÊÌâ
matlab µÄÈ˻شð¹ý £º
std2 µ÷ÓõÄÊÇ std µÄËã·¨£¬Ò²¾ÍÊÇ˵£¬ËüÓõÄÊÇĬÈ쵀 (N-1)£¬ ³ý·Ç°Ñ std ÀïÃæµÄ²ÎÊý FLAG==0 £¬±ä³É FLAG==1
4Â¥2013-06-27 14:43:54
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
²é¿´È«²¿ 4 ¸ö»Ø´ð

ÔÂÖ»À¶

Ö÷¹ÜÇø³¤ (Ö°Òµ×÷¼Ò)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
csgt0: ½ð±Ò+1, лл 2013-06-28 11:32:57
ĬÈϵÄÊÇN-1°É£¬ÒÔÏÂÊÇMATLAB °ïÖúÎĵµµÄ˵Ã÷£º
STD Standard deviation.
    For vectors, Y = STD(X) returns the standard deviation.  For matrices,
    Y is a row vector containing the standard deviation of each column.  For
    N-D arrays, STD operates along the first non-singleton dimension of X.

    STD normalizes Y by (N-1), where N is the sample size.  This is the
    sqrt of an unbiased estimator of the variance of the population from
    which X is drawn, as long as X consists of independent, identically
    distributed samples.

    Y = STD(X,1) normalizes by N and produces the square root of the second
    moment of the sample about its mean.  STD(X,0) is the same as STD(X).

    Y = STD(X,FLAG,DIM) takes the standard deviation along the dimension
    DIM of X.  Pass in FLAG==0 to use the default normalization by N-1, or
    1 to use N.
MATLAB¡¢MSСÎÊÌâ¡¢ÆÕͨÎÊÌâÇë·¢ÌûÇóÖú£¡Ê±¼ä¾«Á¦ÓÐÏÞ£¬Ë¡²»½ÓÊÜÎÞ³¥Ë½ÐÅÇóÖú¡£
2Â¥2013-06-27 10:34:09
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

niexianling

Í­³æ (³õÈëÎÄ̳)

ÒýÓûØÌû:
2Â¥: Originally posted by ÔÂÖ»À¶ at 2013-06-27 10:34:09
ĬÈϵÄÊÇN-1°É£¬ÒÔÏÂÊÇMATLAB °ïÖúÎĵµµÄ˵Ã÷£º
STD Standard deviation.
    For vectors, Y = STD(X) returns the standard deviation.  For matrices,
    Y is a row vector containing the standard devi ...

ÎÒÏëÖªµÀµÄÊÇstd2º¯Êý
do
3Â¥2013-06-27 11:00:36
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[»ù½ðÉêÇë] ͶƱ:  ÓжàÉÙÈËÊǽñÌì²éϵͳ֪µÀ½á¹ûµÄ£¿ +15 °®¿´ÊéµÄ¿ÉÀÖ 2026-08-26 17/850 2026-08-27 11:29 by xxniao123
[»ù½ðÉêÇë] Ϊʲô×ÊÖúÊý¸÷´ó¸ßУ¶¼´´Ð¸ߣ¬×Ô¼ºÉêÇëÔõô¾ÍÕâôÄÑ +3 Kittylucky 2026-08-27 3/150 2026-08-27 11:12 by marinewhale
[½Ìʦ֮¼Ò] µ¼Ê¦Í²ۣºÎÒÔõô̯ÉÏÁËÕâô¸ö¼«Æ·Ñо¿Éú£¡ +5 ËÕ¶«ÆÂ¶þÊÀ 2026-08-23 5/250 2026-08-27 10:39 by ì¿Óê
[»ù½ðÉêÇë] ¹ú×ÔÈ»ÃæÉϸ´ÅÌ~»¶Ó­ÌÖÂÛ +7 ÇçÌì¼ÓÓÍ 2026-08-26 8/400 2026-08-27 07:53 by longfie172
[½Ìʦ֮¼Ò] ÊÛSCIÒ»ÇøÎÄÕ£¬ÎÒ:8.O.551.O.5.4,¿ÆÄ¿È«,¿ÉÙ¤¼± +3 LIbGuocjEEYw 2026-08-26 4/200 2026-08-27 04:33 by Ie9AyIAvGbvs
[˶²©¼ÒÔ°] ÊÛSCIÒ»ÇøT0PÎÄÕ£¬ÎÒ:8.O.55.1.O.54,¿ÆÄ¿ÆëÈ«,¿É+¼± +3 LIbGuocjEEYw 2026-08-26 4/200 2026-08-27 02:01 by Ie9AyIAvGbvs
[»ù½ðÉêÇë] Ôõô²é°¡ +5 huang1991js 2026-08-26 5/250 2026-08-26 16:09 by Equinoxhua
[»ù½ðÉêÇë] ÄÜ·ñÍ˳ö²ÎÓëµÄÃæÉÏÏîÄ¿½â³ýÏÞÏî +23 koalala 2026-08-24 26/1300 2026-08-26 14:29 by ±¦±´³æ×Ó
[»ù½ðÉêÇë] Ϊʲô¹ú×ÔÈ»²»ÄÜÖ±½Ó¹«²¼ +4 bjdxyxy 2026-08-26 4/200 2026-08-26 13:12 by qingmu1201
[»ù½ðÉêÇë] ¹ú¼ÊºÏ×÷¿É²éÁË£¬ÖÐÁËÃæÉÏ +18 Ldrop2023 2026-08-26 18/900 2026-08-26 11:15 by cmrandy
[»ù½ðÉêÇë] ¹úºÏ¿É²éÁË +3 paperzjh 2026-08-26 3/150 2026-08-26 10:41 by LemmonTr
[»ù½ðÉêÇë] ½ñÌìÎñί»á¿ªÍêÁË£¬Ã÷Ìì³ö½á¹ûÂð +19 angus9576 2026-08-25 23/1150 2026-08-26 10:03 by zp519
[Ö°³¡ÈËÉú] ѧÉúײ¼û¸¨µ¼Ô±ËÍÍâÂô£¬µÚ¶þÌìÈ«°à¶¼³ÁĬÁË +3 ¾¨ÓãÈÚ½ð_Õã½­_É 2026-08-22 3/150 2026-08-26 09:01 by zzuzxg
[»ù½ðÉêÇë] Å£À´£¡Ã×À´£¡ÃæÀ´£¡ +8 beefly 2026-08-26 8/400 2026-08-26 08:37 by xuzhipiao
[»ù½ðÉêÇë] ÔÚ¼á±ù»¹¸Ç×ű±º£µÄʱºò£¬ÎÒ¿´µ½ÁËÅ­·ÅµÄ÷»¨¡£ (½ð±Ò+10) +6 ziyangfang 2026-08-25 9/450 2026-08-25 20:26 by huagongfeihu
[»ù½ðÉêÇë] ûÓÐÈκÎÏûÏ¢-ÊDz»ÊǾÍÁ¹ÁË +9 ͼÀ²Í¼À² 2026-08-24 10/500 2026-08-25 11:59 by ÄϺ£Ð¡¸ç
[»ù½ðÉêÇë] ½¨Òé»ù½ð·¢²¼Ìáǰ¸ø³öÃ÷È·µÄʱ¼äµã +13 kulium 2026-08-21 16/800 2026-08-24 16:27 by superceng
[»ù½ðÉêÇë] ʱ¼ä´ÁÓÖ±äÁË +13 wuchongjun 2026-08-20 19/950 2026-08-21 17:21 by ×Ïɼ´¼
[»ù½ðÉêÇë] Ó¦¸ÃÊÇÏÂÖÜÈý26ÈÕ¹«²¼Á˰ɣ¿ +4 ¹þ¹þ¸ò£¿ 2026-08-21 4/200 2026-08-21 10:58 by Vivilian
[»ù½ðÉêÇë] »ù½ð°¡»ù½ð +4 longfie172 2026-08-20 4/200 2026-08-21 08:58 by mark mao
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û