This program is to evaluate a grid (array) of land elevations. One important characteristic of the grid is the number and location of the peak elevations. The number of peaks in the grid determines the level of difficulty for flying over the grid. A peak is a location whose elevation is equal to or greater than all of the surrounding points. Another important characteristic is the number and location of points that are above the timberline. The timberline is an elevation above which no trees will grow. The timberline is generally located between the average elevation and the maximum elevation. The elevation value that defines the timberline will vary depending on the geographic location of the land grid and so an appropriate value must be input by the user. One user-defined function is to be generated that will determine the location of all peaks in the land grid. A peak is defined as a point that has an equal or higher elevation than the surrounding points as seen below. Since the border points (the first and last row and the first and last column) do not have all the necessary surrounding points to check, you are not to report any peaks along the border of the grid. This user-defined function will take as input the array containing the elevation values and return as output the x and y locations of all of the peaks. Finally, the main script is to handle all input and output required as well as calling on the user-defined function and intrinsic functions for calculations. The program is to be written to operate on any data file of any size with any file name. After all of the peaks have been located, use the find function to locate the elevations that are above the timberline. Before doing this, print to the screen the overall average elevation and the overall maximum elevation within the land grid. This will give the user important information for determining an appropriate value to use for the timberline elevation. The output from the program will include ONE plot that contains both the x and y coordinate locations of each peak and the x and y coordinate locations of all grid points above the timberline elevation. This plot is to show only markers and no lines, be sure to identify which markers represent peaks and which represent elevations above the timberline. NOTE: Do NOT print to the screen the locations of the peaks or the location of the elevations above the timberline. This would waste too much paper. Plotting these values is sufficient for this assignment. Please create a MATLAB script file acting as if you are uploading a .dat file that has all the necessary values. Using an arbitrary name for the dat file.
This program is to evaluate a grid (array) of land elevations. One important characteristic
of the grid is the number and location of the peak elevations. The number of peaks in the grid
determines the level of difficulty for flying over the grid. A peak is a location whose elevation is
equal to or greater than all of the surrounding points. Another important characteristic is the
number and location of points that are above the timberline. The timberline is an elevation
above which no trees will grow. The timberline is generally located between the average
elevation and the maximum elevation. The elevation value that defines the timberline will vary
depending on the geographic location of the land grid and so an appropriate value must be input
by the user.
One user-defined function is to be generated that will determine the location of all peaks
in the land grid. A peak is defined as a point that has an equal or higher elevation than the
surrounding points as seen below. Since the border points (the first and last row and the first and
last column) do not have all the necessary surrounding points to check, you are not to report any
peaks along the border of the grid. This user-defined function will take as input the array
containing the elevation values and return as output the x and y locations of all of the peaks.
Finally, the main script is to handle all input and output required as well as calling on the
user-defined function and intrinsic functions for calculations. The program is to be written to
operate on any data file of any size with any file name. After all of the peaks have been located,
use the find function to locate the elevations that are above the timberline. Before doing this, print
to the screen the overall average elevation and the overall maximum elevation within the land grid.
This will give the user important information for determining an appropriate value to use for the
timberline elevation. The output from the program will include ONE plot that contains both the x
and y coordinate locations of each peak and the x and y coordinate locations of all grid points
above the timberline elevation. This plot is to show only markers and no lines, be sure to identify
which markers represent peaks and which represent elevations above the timberline. NOTE: Do
NOT print to the screen the locations of the peaks or the location of the elevations above the
timberline. This would waste too much paper. Plotting these values is sufficient for this
assignment.
Please create a MATLAB script file acting as if you are uploading a .dat file that has all the necessary values.
Using an arbitrary name for the dat file.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps