Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Taking average of specific data from a data set
Replies: 2   Last Post: Feb 7, 2013 8:50 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Sadik

Posts: 382
Registered: 1/12/09
Re: Taking average of specific data from a data set
Posted: Feb 7, 2013 8:50 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi Badrul,

You can do the following:

data = [0.11, -1.11, -0.75, -0.02, -0.36, -0.97, -0.35, -1.02, -1.33, -1.00, -0.15, -0.66, -0.59, -1.21, -0.70, 0.06, -1.65, 0.03, 0.25, -1.35, -0.08,-0.91, -0.82, -1.29, -0.26]
mask = data < -0.5;
L = bwlabel(mask)
r = regionprops(L,data,'mean');
eventMeans = struct2array(r)
mean(eventMeans)

Best.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.