Jump to content

Help With Mathematica Program

Featured Replies

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?

Archived

This topic is now archived and is closed to further replies.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.