MATLAB Answers

John
0

The mean of a subset of data

Asked by John
on 7 Jan 2013

Hello,

I have a vector of acceleration values, both positive and negative negative numbers.

How could I find the mean value of the values greater than 0 only? i.e. the mean positive acceleration?

Thank you

  0 Comments

Tags

Products

No products are associated with this question.

1 Answer

Answer by José-Luis
on 7 Jan 2013
 Accepted answer
 mean(your_data(your_data>0));

  0 Comments


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!