DJBruce Posted May 14, 2011 Posted May 14, 2011 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?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now