MATLAB: Plotting standard deviation using normfit

data processingnormfitplot

I have a matrix amp which is having dimension of [50000*100]. In which number of rows represents number of measurements. Using "normfit" fucntion i am getting standard deviation for different measurements like below.
[sigma, standard_deviation] = normfit(amp(1:10, 50));
[sigma, standard_deviation] = normfit(amp(1:100, 50));
[sigma, standard_deviation] = normfit(amp(1:1000, 50));
[sigma, standard_deviation] = normfit(amp(1:5000, 50));
[sigma, standard_deviation] = normfit(amp(1:10000, 50));
[sigma, standard_deviation] = normfit(amp(1:20000, 50));
how to catch, standard_deviation in a matrix and plot number of measurments vs standard deviation.

Best Answer

Using normfit to calcualte the standard deviation is taking the long way round, since you’re not asking for the other outputs it can give you.
Use this instead:
len = [10, 100, 1000, 5000, 10000, 20000];
for k1 = 1:length(len)
standard_deviation(k1) = std(amp(1:len(k1), 50));
end
figure(1)
plot(len, standard_deviation)
grid
Related Question