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

ÔÂÖ»À¶

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

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

¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +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µÄ»ØÌû

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µÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ niexianling µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[½Ìʦ֮¼Ò] ÊÛSCIÒ»ÇøÎÄÕ£¬ÎÒ:8.O.551.O.5.4,¿ÆÄ¿È«,¿ÉÙ¤¼± +3 LIbGuocjEEYw 2026-08-26 4/200 2026-08-27 04:33 by Ie9AyIAvGbvs
[»ù½ðÉêÇë] ¿´°åÉÏÕâô¶àÖеģ¬ÓеãÏñ50ÈËȺÀï49¸öÈ˶¼ÊÇÆ­×ÓµÄÄÇÖָоõ¡­¡­ +3 a089 2026-08-26 3/150 2026-08-26 23:21 by young90
[»ù½ðÉêÇë] ÎÒ²»Àí½â£¡ +15 Edward_pc 2026-08-26 23/1150 2026-08-26 20:34 by zzuzxg
[»ù½ðÉêÇë] Ôõô²é°¡ +5 huang1991js 2026-08-26 5/250 2026-08-26 16:09 by Equinoxhua
[»ù½ðÉêÇë] 2026¹ú×ÔÈ»º¯ÆÀ·Ñµ½ÕË +22 ÑòÑü°å 2026-08-21 25/1250 2026-08-26 15:00 by zuocuiping
[»ù½ðÉêÇë] 2026Äê8ÔÂ25ÈÕ¹ú×ÔÈ»·Å°ñǰͻȻÊÕµ½ÁÐÈëÆÀÉóר¼ÒÓʼþ£¬ÓйØÏµÂ𣿠+25 ľˮ˼¶¹ 2026-08-25 28/1400 2026-08-26 14:53 by draco1987
[»ù½ðÉêÇë] ¿ÆÑй¶ùÌ«ÄÑÁË +21 ÎÒ4´ó°×²Ë 2026-08-20 22/1100 2026-08-26 11:29 by nlgza
[»ù½ðÉêÇë] ¹úºÏÀïÃæÄÜ¿´µ½ÁË +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
[»ù½ðÉêÇë] Å£À´£¡Ã×À´£¡ÃæÀ´£¡ +8 beefly 2026-08-26 8/400 2026-08-26 08:37 by xuzhipiao
[»ù½ðÉêÇë] ½ñÈÕ²»·Å°ñ£¿Íø´«¹ú×ÔȻԤ¼Æ 8 Ô 27 Èտɲé½á¹û +17 ҽѧÀÏÄк¢ 2026-08-20 22/1100 2026-08-25 15:36 by ҽѧÀÏÄк¢
[½Ìʦ֮¼Ò] µ¼Ê¦Í²ۣºÎÒÔõô̯ÉÏÁËÕâô¸ö¼«Æ·Ñо¿Éú£¡ +3 ËÕ¶«ÆÂ¶þÊÀ 2026-08-23 3/150 2026-08-25 10:35 by shisan1313
[»ù½ðÉêÇë] ÈÃÎÒÖÐÒ»¸öÃæÉϰɣ¡ +13 ´óƼ1987 2026-08-20 16/800 2026-08-24 10:23 by ̫ɵÁË
[»ù½ðÉêÇë] ʱ¼ä´Á½ñÌ죬20ºÅ±äÁË +5 archvillain 2026-08-20 5/250 2026-08-22 06:12 by hui_daxiao
[»ù½ðÉêÇë] ¿´À´½ñÌì²»»á·Å°ñÁË£¿ +8 chengyan1220 2026-08-21 11/550 2026-08-21 17:52 by dcqxinyang
[»ù½ðÉêÇë] ʱ¼ä´ÁÓÖ±äÁË +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
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û