| 查看: 2162 | 回复: 3 | ||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | ||
niexianling铜虫 (初入文坛)
|
[求助]
matlab中std2函数计算矩阵的标准差时,分母是除以了n-1还是n?
|
|
|
matlab中std2函数计算矩阵的标准差时,分母是除以了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 |
» 猜你喜欢
反铁磁体中的磁性切换:两种不同的机制已成功可视化
已经有0人回复
求标准粉末衍射卡号 ICDD 01-076-1802
已经有0人回复
物理学I论文润色/翻译怎么收费?
已经有228人回复
新西兰Robinson研究所招收全奖PhD
已经有0人回复
石墨烯转移--二氧化硅衬底石墨烯
已经有0人回复
笼目材料中量子自旋液体基态的证据
已经有0人回复
数学教学论硕士可以读数学物理博士吗?
已经有0人回复
德国亥姆霍兹Hereon中心汉堡分部招镁合金腐蚀裂变SCC课题方向2026公派博士生
已经有4人回复
澳门大学 应用物理及材料工程研究院 潘晖教授课题组诚招博士后
已经有9人回复

niexianling
铜虫 (初入文坛)
- 应助: 0 (幼儿园)
- 金币: 20
- 红花: 2
- 帖子: 50
- 在线: 23.4小时
- 虫号: 1661372
- 注册: 2012-03-03
- 性别: MM
- 专业: 化学计量学与化学信息学

3楼2013-06-27 11:00:36







);
回复此楼