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

Thread Subject:
Center of gravity of discrete graph

Subject: Center of gravity of discrete graph

From: rocky99 Therminator

Date: 9 Feb, 2009 19:28:01

Message: 1 of 2

I'd like to find the center of gravity of a discrete graph. I have the vector (1x200) of the values of the x-axis and the vector (1x200) of the values of the y-axis. (Y is a spectrum and X is a frequency). I need the frequency (x-value) of the center of gravity of this graph.
Any help would be highly appreciated. Thanks

Subject: Center of gravity of discrete graph

From: Roger Stafford

Date: 9 Feb, 2009 20:31:02

Message: 2 of 2

"rocky99 Therminator" <ronenk@mail.com> wrote in message <gmq041$2g2$1@fred.mathworks.com>...
> I'd like to find the center of gravity of a discrete graph. I have the vector (1x200) of the values of the x-axis and the vector (1x200) of the values of the y-axis. (Y is a spectrum and X is a frequency). I need the frequency (x-value) of the center of gravity of this graph.
> Any help would be highly appreciated. Thanks

  What do you mean here by the "center of gravity"? If each point is considered to have a weight of one, then the graph's center of gravity would have an x-value of mean(x), which is totally independent of the y-values. Perhaps you mean to have the "center of gravity" of the x-values weighted by the corresponding y-values. Then it would be mean(x.*y)/mean(y). It all depends on what meaning you have in mind for a "center of gravity."

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us