Your definition of a constant (or invariant) data with rand is problematic. If you increase the size of your data (n=1000, n=10000...), you can always increase the deviations (so what threshold for sigma ?). I think that with real data, this artifact isn't possible. No ?
Nice solution that looks pretty nifty but it actually produces an unsafe result, just like Matlab's own zscore. It passed on it's first run trough the test suite but fails on some number of repeats. I've now added a second pass with a know random seed.
9839 Solvers
832 Solvers
168 Solvers
75 Solvers
399 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!