Write a single expression to compute a vector k, such that each element of k is related to the corresponding element of j via the relation below.

In this activity you will

Create a well-documented MATLAB script
Practice MATLAB commands for mathematical computations
Practice MATLAB commands for working with variables, vectors, and matrices
Practice MATLAB commands for conditions
Practice MATLAB commands for simple loops
Practice MATLAB commands for 2D plots

Submission format

For this activity, instead of using a word processor, you’ll type everything into a script file in MATLAB. You shall use comments  in the script file to explain, organize, and document various parts. In the end, you’ll publish this script file as a single PDF file. That is what you’ll submit here.

Start by creating a MATLAB script for ALL the MATLAB work for this activity. As a comment at the top, write the name of this activity. As a comment in a line below it, write your name. Below these, the rest of the activity starts.

Before starting each part of this activity, type %% to create a new section. Write the part number/heading after this %%.
Before starting each subpart type % and write the subpart number/heading. This is how you can neatly organize various parts.

Be very organized, neat, and professional. You should use consistent spacing, formatting, font, and style, as well as correct grammar and spelling. You want the grader to find all your work in a convenient way lest you may lose points.

In the end, publish your script as a pdf file by clicking the ‘PUBLISH’ tab on the top menu, clicking the ‘Publish’ button for the drop down menu, choosing ‘Editing Publish Options’, changing the Output File Format from html to pdf, and clicking ‘Publish’. See screenshots below. Submit this single pdf file for this activity.

Publish in MATLAB.JPG PublishinMATLAB1.JPG
If publishing doesn’t work for you, you can paste your whole MATLAB script/code into a word processor. Then convert that into a single pdf file.

Instructions

Complete the following parts as separate sections in your script.
Make sure to document your script using comments, as requested in the rubric below.

Part 1. In the script, enter the commands to perform the following three calculations, using the equivalent MATLAB operators and functions:
5e2183e756b5ec765f7287693239614d.png
a9950486e3aa8fffa1809653dfa6d1da.png
a47ff07ae062e4abd4c01e252f2c0e9c.png
Part 2. In the script, complete the following steps
Write 3 different methods to define the following row vector:
j = [-6 -3 0 3 6 9 12]
Hint: One of them is visibly obvious, for the other two notice the pattern in the numbers.
Write a single expression to compute a vector k, such that each element of k is related to the corresponding element of j via the relation below.
k = 2j2 -6j +13
Hint: Your answer will be a row vector of 7 elements . The first element of the answer will be 121.
Part 3. In the script, define the variable “MB” as the number of the month you were born. The value inside this variable can be a number of your choice from 1 to 12. That is, initialize the variable MB with a chosen number from 1 to 12.
For example if my birthday is in October, MB would equal 10
With this variable defined, write an if-elseif-else statement so that, when executed,
If you are born in a Spring monththen the word ‘spring’ is displayed in the command window.
If you are born in a Summer month then the word ‘summer’ is displayed in the command window.
If you are born in a Fall month  then the word ‘fall’ is displayed in the command window.
If you are born in a Winter month  then the word ‘winter’ is displayed in the command window.

Verify that the code works various values of the variable MB.
Hint: See this page for displaying text on command window: https://www.mathworks.com/help/matlab

Last Completed Projects

topic title academic level Writer delivered
© 2020 EssayQuoll.com. All Rights Reserved. | Disclaimer: For assistance purposes only. These custom papers should be used with proper reference.