100%(6)6 out of 6 people found this document helpful
This preview shows page 1 - 5 out of 19 pages.
The preview shows page 4 - 5 out of 19 pages.
Week 2 HomeworkENGR 112Arrays and plottingName: Guanyun QiaoLab Time(ECampus write “ECampus”):W 1000Names of people you worked with:•Websites you used:•Approximately how many hours did it take you to completethis assignment (to nearest whole number)?6By writing or typing your name below you affirm that all of the work containedherein is your own, and was not copied or copied and altered.Note: Failure to sign this page will result in a 50-point penalty. Failure to list people you workedwith may result in no grade for this homework. Failure to fill out hours approximation willresult in a 10-point penalty.Turn .zip files to Canvas or your assignment will not be graded
Week 2 HomeworkENGR 112Arrays and plottingLearning Objectives:You should accomplish the following:•Understand how to create arrays, calculate with them, and extract data from them.•Plot the results of calculations.•Be able to split up plots into multiple windows•Plot multiple things in the same window with different colors and attributes.Homework Guidelines:1)Use example scripts from online for help plotting and vectors.2)Save scripts as “HW2Script1.m” for problem 1, “HW2Script2.m” for problem 2, etc.Specific Coding Notes:Plotting –Label axes (with units when known), use titles, and use legend when plotting morethan one thing on a graph.Example:☹"#$NO☹"#$࠽?’()*YES࠽?’()*Warnings and Errors –You may see orange and red bars on the right-hand side of the editor.Orange bars are warnings and red bars are errors. Hovering with the cursor over a par will showyou the problem.Example:
Week 2 HomeworkENGR 112Arrays and plottingGrading CheckpointsCriteriaComponentNoYes[30%] Comments andPseudocodeDeclared units on all variables?XEnglish description of problem at top?XComments outlining your steps?X[20%] Output formattingUsed fprintf() to make complete sentences(when required)?XCorrect units on answers?XCorrect number of decimal places?XProper labels on graphs/plots?X[50%] FunctionalityScript computes/plots correct value(s)?XDid you use the correctrangesfor inputvariables?X
Week 2 HomeworkENGR 112Arrays and plottingProblem 1a)Plot the following mathematical function in the domain -10 ≤ t ≤ 7 in increments of 0.004.Assume that the x-axis is time measured in seconds, and the y-axis is distance measuredin meters. Print the minimum and maximum values of y for that range of ts, and the t-values that produce the minimum and maximum values. Label the axes with time inseconds (t) and distance in meters (y).a.Hint: Look up the different versions of the function min/max.b)Check the minimum value against theanalyticsolution (hint: minimum and maximumvalues occur when the derivative is zero).