From: Jose on 28 Dec 2009 15:48 Thanks a lot!
From: Jose on 28 Dec 2009 15:49 Thanks a lot!
From: Neil on 28 Dec 2009 16:10 "Jose " <mylordjose(a)hotmail.com> wrote in message <hhb33c$d0a$1(a)fred.mathworks.com>... > Hello, > > I need to get the standar deviation from a vector, but the promem is that inside that vector I have some zero value that can not be included in the calculation. > > I mean lets say I have the vector A=[5, 6, 8, 0, 4,8, 0, 8] > I need the standard deviation without considering zero values. > > Thank you very much for your help. > Jose Maybe logical addressing might be an alternative. grunk = std(A(A~=0)); m-lint always seem to tell me logical addressing is faster than find. I'd have to say though, that if you can, change your flag value: using say, nan rather than 0 would be clearer as 0 is a valid numerical value. grunk = std(A(~isnan(A));
First
|
Prev
|
Pages: 1 2 Prev: VisualDSP link fails Next: accessing base workspace from a nested function within a GUI |