{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

get_points

# get_points - long_mean = 96.323091666666656 long_std =...

This preview shows page 1. Sign up to view the full content.

function [lat, long] = get_points % % GET_POINTS Generates 100 random points near Wixon Valley, Texas % % This function generates 100 random points in decimal latitude and % longitude near Wixon Valley, Texas, for use in Programming Assignment #2. % % Define Variables: % lat -- Latitude of points in decimal degrees % long -- Longitude of points in decimal degrees % % Example: % [lat, long] = get_points; % % Scott A. Socolofsky % CVEN 302, Fall 2009 % August 2009 % Define the desired center and spread in the distribution of points (mean % is the average and std is the standard deviation lat_mean = 30.763544658119656; lat_std = 0.008172784341075;
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: long_mean = 96.323091666666656; long_std = 0.013160110592331; % Generate 100 random point sets from a normal distribution with mean of % zero and standard deviation of 1 n = 100; randn('state', sum(100*clock)); % Causes random number generator to % be different for each student rcoor = randn(n,2); % Convert the zero-mean data to the appropriate distribution lat = zeros(n,1); % Create the arrays before filling in order long = zeros(n,1); % to increase speed for i = 1:n lat(i) = lat_mean + lat_std*rcoor(i,1); long(i) = long_mean + long_std*rcoor(i,2); end...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online