From: Jose on 28 Dec 2009 15:06 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
From: Vince Petaccio on 28 Dec 2009 15:17 "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 Asorted=sort(A); zeroloc=find(A==0); ANoZeros=Asorted(max(zeroloc)+1:length(Asorted)); StandardDeviation=std(ANoZeros);
From: Dave Berger on 28 Dec 2009 15:30 "Vince Petaccio" <vince(a)moberg.com> wrote in message <hhb3o1$nb9$1(a)fred.mathworks.com>... > "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 > > Asorted=sort(A); > zeroloc=find(A==0); > ANoZeros=Asorted(max(zeroloc)+1:length(Asorted)); > StandardDeviation=std(ANoZeros); or std(A(A~=0))
From: Andy on 28 Dec 2009 15:37 "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 % No need to do any sorting: A=[5, 6, 8, 0, 4,8, 0, 8]; s=std(A(A~=0));
From: Vince Petaccio on 28 Dec 2009 15:43 "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 ^ What they said. :oD
|
Next
|
Last
Pages: 1 2 Prev: VisualDSP link fails Next: accessing base workspace from a nested function within a GUI |