matlab學習之數據分析

clear all
load count.dat
c3 = count(:,3); % 第三列數據
c3NaNCount = sum(isnan(c3));
h = histogram(c3,10); % 直方圖,橫座標爲值,縱座標爲組數
N = max(h.Values); % 求最大值

mu3 = mean(c3); % 求平均值
sigma3 = std(c3); % 求均方差
hold on
plot([mu3 mu3],[0 N],'r','LineWidth',2) % Mean
X = repmat(mu3+(1:2)*sigma3,2,1);
Y = repmat([0;N],1,2);
plot(X,Y,'Color',[255 153 51]./255,'LineWidth',2) % Standard deviations
legend('Data','Mean','Stds')
hold off

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章