Question: 7 . Create a vector x with the elements, xn = ( 1 ) + 1 2 n 1 , where n = { 1
Create a vector x with the elements,
xn
n
where n
Then, add up the elements of the version of this vector that has elements.
Make multi plots for the following two functions in one figure as shown below. Do not forget to add
the axis labels, a title, and grid.
fx sinx for x
fx cosx for x
Code Hint:
figure
subplot;
Add your code for plotting the sinx function
subplot;
Add your code for plotting the cosx function
subplot:;
Add your code for plotting the two functions together use hold on
Create your own function that returns the inverse of your inputs.
For example, if your input vector, r is equal to The output of your function must be
Example:
r ;
b yourfunctionnamer;
b
b
Given the vector x using for loop create a short set of commands that will
Add up the values of the elements.
Create a by array of random numbers use rand Move through the array, element by element,
and set any value that is less than to and any value that is greater than or equal to to
Given x and y compute the following arrays
a dij xi xi yj
b eij reciprocal of the lesser of xi and yj
Write a script that asks for a temperature in degrees Fahrenheit and computes the equivalent
temperature in degrees Celsius. The script should keep running until no number is provided to convert.
Note: the function isempty will be useful here.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
