Delete - Variance vs standard deviation when using var() and std() with decimal values from CSV file?
13 ビュー (過去 30 日間)
古いコメントを表示
Hello all!
I am getting a strange error in Matlab where the variance is smaller than the standard deviation when using var() and std(), despite the fact that I am working with nW of optical power. (This is correct - the standard deviation is the square root of the variance.) The code I am using is as follows:
[D,S] = xlsread('2019-11-21_Empirical_Experiment_2.0_2.0_3.csv');
Vars = strsplit(S{15},';');
for k = 16:size(S,1)
DataC = strsplit(S{k},';');
pwr_2_2(k-15,:) = str2double(DataC{4});
end
mpwr_2_2=mean(pwr_2_2)
vpwr_2_2=var(pwr_2_2)
spwr_2_2=std(pwr_2_2)
The csv file is attached. I am at a loss for how to exactly diagnose this issue and I welcome any advice that you can give. I thought that the method for importing the data from the csv (thanks to some help from Matlab Answers!) was working well, but maybe the issue is rooted in the data import? Thanks in advance, and let me know if there are any questions!
0 件のコメント
採用された回答
Philippe Lebel
2019 年 11 月 22 日
Isn't this normal?
As the variance is the square of the standard deviation?
0.1^2 = 0.01
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!