²é¿´: 2374  |  »Ø¸´: 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µÄ»ØÌû

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µÄ»ØÌû
²é¿´È«²¿ 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µÄ»ØÌû

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µÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[»ù½ðÉêÇë] »ù½ð²»ÖУ¬¹²Ãã +8 eulota 2026-08-26 8/400 2026-08-27 12:34 by lice_1987
[»ù½ðÉêÇë] Ôõô¿´Çà»ùÖÐÁËûÓа¡ +5 Ò¶¾Å΢ 2026-08-26 5/250 2026-08-27 10:35 by l_zh2008
[ÎÄѧ·¼²ÝÔ°] ÃÎÏë +3 myrtle 2026-08-26 3/150 2026-08-27 10:01 by angelyueyi
[»ù½ðÉêÇë] Ϊʲô ¹ú¼Ê(µØÇø)ºÏ×÷Óë½»Á÷ÏîÄ¿ ûÓзŰñ£¿ 10+3 majunge000 2026-08-26 11/550 2026-08-27 08:42 by ±±¾©À³Òð±à¼­
[½Ìʦ֮¼Ò] ÊÛSCIÒ»ÇøÎÄÕ£¬ÎÒ:8.O.551.O.5.4,¿ÆÄ¿È«,¿ÉÙ¤¼± +3 LIbGuocjEEYw 2026-08-26 4/200 2026-08-27 04:33 by Ie9AyIAvGbvs
[»ù½ðÉêÇë] ÎÒ²»Àí½â£¡ +15 Edward_pc 2026-08-26 23/1150 2026-08-26 20:34 by zzuzxg
[»ù½ðÉêÇë] ÄÜ·ñÍ˳ö²ÎÓëµÄÃæÉÏÏîÄ¿½â³ýÏÞÏî +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
[»ù½ðÉêÇë] ¹úºÏÀïÃæÄÜ¿´µ½ÁË +7 Ò»»³Ü°Çï 2026-08-26 7/350 2026-08-26 11:23 by zhaosm1982
[»ù½ðÉêÇë] ¹ú¼ÊºÏ×÷¿É²éÁË£¬ÖÐÁËÃæÉÏ +18 Ldrop2023 2026-08-26 18/900 2026-08-26 11:15 by cmrandy
[»ù½ðÉêÇë] ϵͳ½ø²»È¥ +4 yanglien 2026-08-26 5/250 2026-08-26 11:10 by wenfengw83
[»ù½ðÉêÇë] ½ñÌìÎñί»á¿ªÍêÁË£¬Ã÷Ìì³ö½á¹ûÂð +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
[»ù½ðÉêÇë] Ã÷ÌìÓ¦¸Ã¿É²éÁË£¡£¿ +6 chengyan1220 2026-08-23 6/300 2026-08-25 19:45 by zfd97
[»ù½ðÉêÇë] ijЩ»ú¹¹£¬ÒÔЧÂʵÍΪÈÙ£¬ÒÔЧÂʵÍ×÷Ϊ´æÔڸР+9 yuleib84 2026-08-25 10/500 2026-08-25 17:14 by alexon
[»ù½ðÉêÇë] Èç¹û´Ë¿ÌÄãÕýÔÚΪ¹ú»ù¸Ðµ½½¹ÂÇ£¬²»·ÁÀ´ÌýÌýÕâÊס¶»ù½ðÖ®Íâ¡· +8 scalable 2026-08-24 8/400 2026-08-25 12:52 by jnhyjjm
[»ù½ðÉêÇë] ÎÒÃæÉÏÍêµ°ÁË +13 ÇÒÌý»¢Ð¥ 2026-08-20 14/700 2026-08-25 09:10 by mrkang
[½Ìʦ֮¼Ò] Ìø²ÛºóÔÚÑÐÏîÄ¿Ôõô°ì£¿ +5 ¼òµ¥»¯xn 2026-08-22 10/500 2026-08-23 12:38 by ¼òµ¥»¯xn
[»ù½ðÉêÇë] ʱ¼ä´Á½ñÌ죬20ºÅ±äÁË +5 archvillain 2026-08-20 5/250 2026-08-22 06:12 by hui_daxiao
[»ù½ðÉêÇë] »ù½ð°¡»ù½ð +4 longfie172 2026-08-20 4/200 2026-08-21 08:58 by mark mao
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û