Description
Problem 1: Logistics (0 points)
- Ensure you have a picture on D2L
- Install MATLAB on your computer and bring it to class (if you can)
Problem 2: MATLAB Practice (10 points)
- Write the MATLAB script that does the following steps
- Create an array A of 20 zeros
- Put a 1 in the second entry in the array, i.e., A = [0,1,0,…,0]
- Loop over the third to twentieth entries and compute the value by adding the previous two values.
For example A(3) = A(1) + A(2) and A(4) = A(2) + A(3).
- Display the final result along with the name of this famous sequence of numbers
- Create a line plot of the functions y = sin(x) and y = cos(x) on the interval x = [−π,π] with 1000 grid points. Label your axes, adjust the font size so the figure looks good, add a legend with line types that easily distinguishable.
- Find a picture that depicts your summer and use MATLAB to display the image with a title and caption describing the activity.
- Using the Publish feature in MATLAB, save your code and output as a pdf with the filename following this convention. File Naming: All MATLAB scripts should follow the following format
Lastname_Firstname_Sec###_HW#.m
Example: For John Doe homework assignment 1 for section 003 it would be written as
Doe_John_Sec003_HW1.m
Turn in the PDF of your MATLAB code that includes your output (e.g., figures) to GRADESCOPE. Also, upload your code (m-file) to the assignment folder on D2L. Be sure your code has comments explaining what is being done, as this is good programming practice.
Page 1 of 1