Jump to content

Help With Mathematica Program


DJBruce

Recommended Posts

So I am trying to create a Mathematica program where I will give it a set of data, and a desired radius. The program will then create a new data point at each a position on a circle with desired radius, and calculate the spatial median median for the original data set, and the that new point. It will then create a new point on the circle, and calculate the spatial median for the the original data set and this second point. It will continue to do this going all around the circle, and then when it is done it will graph the original data set, along with all of the spatial medians it calculated.

 

 

My code is:

<< MultivariateStatistics`
f[r_, Data_] := (temp = 0, x = 0, y = 0; 
 While[temp > 
   360, {x = r*cos (temp Degree),  y = r*sin (temp Degree), 
	Med = {SpatialMedian[Data, {x, y}]}}   temp++]; Med)

 

 

 

 

Can anyone help, or provide some good resources for programing in Mathematica?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.