规范化数据和反向

时间:2015-12-07 15:09:14

标签: matlab

我使用以下代码在MATLAB中规范化我的数据:

Data=[130 100 100 100 300 300 30 300 30 320 200 50 300 25 100 250 1200 300 320 300 100 100 170 500 1000 200 120 450 200 2100 100 100 100 3450 500 30 100 550 4000 150 500 380 400 4000 180 540 700 100 500 2300 200 200 50 2000 400 100 50 50 100 4000 4000 3250 100 100 100 100 3300 100 100 4020 150 150 2300 3000 100 50 100 50 100 200 2000 300]

Data=randn(100,1); 
%Histogram with histfit 
nbins=20; 
h=histfit(Data,nbins); 
[nelements,bincenters]=hist(Data,nbins); 
hold on %histogram computed manually and scaled with trapz() 
avg=mean(Data); 
stdev=std(Data); 
x=sort(Data); 
y=exp(-0.5*((x-avg)/stdev).^2)/(stdev*sqrt(2*pi));     
plot(x,y*trapz(bincenters,nelements),'g','LineWidth',1.5)     
legend('Histogram','Distribution from hisfit','Distribution computed manually')

效果很好,我发现了平均值和标准差。现在,我尝试将y值与ln反转以找回原始点,但是,我没有成功。你能否提出反y值的想法?

0 个答案:

没有答案