Starting from:

$25

EE5003 - Module 9 - Data Structures - MATLAB® Errors and Pitfalls   - Solved

M9 Exercise 

Instructions 

1.    Start with the file loadkepler_template.m to create a function m-file named “loadkepler.m” that loads the Kepler orbital parameters contained in the text file gps_kepler.dat into a structure (the comments in the template file describe the contents of the data file).  Then create a simple driver program named

“test_kepler_LastName.m” that calls the function to load in the data file and also creates a bar chart of the ‘longitude of the ascending node’ parameter using satellite ID number as the x-axis (the call to the ‘bar’ function must, of course, use the created structure in the input arguments.

2.    The m-file create_cell_example.m creates a cell array with the average monthly precipitation values for three cities.  The array also contains the names of the cities, the names of the precipitation types and strings containing abbreviations of the months of the year.  Start with the template file cell_exercise_template.m to create an m-file (named “cell_exercise_LastName.m”) that produces a bar chart of the average monthly rainfall and snowfall for Minneapolis.  You must use cell-array indexing to access the strings for use in the title, legend and x-axis tick labels.

3.    Do a modification of exercise 11.1 on page 260 of chapter 11.  Create a simple function m-file, named “fx2.m” that accepts a vector input and outputs a vector whose elements are the element-wise squares of the input vector elements.  Then create a driver m-file named “ex11p1_LastName.m” that calls fx2.m in order to perform the Newton quotient.  Compute the error in the estimated derivative for h values: 10^(0), 10^(-1), 10^(-2) … 10^(-16).  Use the MATLAB® function ‘semilogx’ to plot the error versus h.   NOTE: You should implement ex11p1_LastName.m without using a FOR loop (i.e., make use of MATLAB®’s vectorization capability).

More products