fork download
  1. x = randn(2560, 1); % test data
  2. ns = length(x); % number of samples
  3. bs = 512; % bin size
  4. bc = floor(ns / bs); % bin count
  5. m = zeros(bc, 1); % array of means
  6. v = zeros(bc, 1); % array of variances
  7. for i = 1 : bc
  8. i1 = (i - 1) * bs + 1;
  9. i2 = i * bs;
  10. b = x(i1 : i2); % current bin
  11. m(i) = mean(b);
  12. v(i) = var(b);
  13. end;
  14. figure;
  15. subplot(211); plot(m, '.-');
  16. subplot(212); plot(v, '.-');
  17. print out.png
Success #stdin #stdout #stderr 2.42s 71360KB
stdin
Standard input is empty
stdout
stderr
warning: print.m: epstool binary is not available.
Some output formats are not available.
warning: print.m: fig2dev binary is not available.
Some output formats are not available.
warning: print.m: pstoedit binary is not available.
Some output formats are not available.