One possible method to plot the distance from the Earth to Enceladus over a year in MATLAB is to use the JPL HORIZONS system to obtain the distance data, and then plot the results using MATLAB's built-in plotting functions.
Here is an example MATLAB function that obtains the distance data from the JPL HORIZONS system and plots the results:
main.m1345 chars33 lines
The plot_enceladus_distance
function sends a JPL HORIZONS query to obtain the distance from the Earth to Enceladus over a 1-year time span with a 1-day time step. It then parses the resulting CSV data and plots the distance data using MATLAB's plot
function.
Note that this function depends on MATLAB's built-in web functions (webread
and weboptions
) to send the JPL HORIZONS query and download the results. If you are unable to use web functions for some reason, you may need to use an alternative method to obtain the JPL HORIZONS data.
gistlibby LogSnag