Question: please complete in mathlab 4- Create an array x with values which range from -5 to 5 with a step of 0.1. Then create another

 please complete in mathlab 4- Create an array x with values

please complete in mathlab

4- Create an array x with values which range from -5 to 5 with a step of 0.1. Then create another array f as follows: f = X.^2 +2*x-1. Finally, create a function ff as follows: ff-@(x)x.^2+2*x-1. Notice that both f and ff are attempting to implement the mathematical function f(x) = X+2x-1. However, only ff is actually a function. The array f simply includes a certain number of values from function f(x). These are the values of f(x) which correspond to those values of the argument x which are equal to the ones found in array x. (a) What is the value of k in f(k) so that f(k) is equal to f(2.3)? Put the answer as a comment in your *.m file, and also explain how you calculated/found the correct value of k. Also include f(k) as one line of code, but replace k with the value that you calculated/found (b) What is the value of m in ff(m) so that ff(m) is equal to f(2.3)? Put this answer as a comment in your *.m file, and also explain how you calculated/found the correct value of m. Also, include ff(m) as one line of code, but replace m with the value that you calculated/found (c) Use x and f to create a plot of the mathematical function f(x) for x ranging from -3 to 3. Show this plot in figure(1). Use a xlabel X, and a ylabel 'f(x). Add a grid to the plot. (d) Now, use x and ff to create a plot of the mathematical function f(x) for ranging from-3 to 3. Show this plot in figure(2). Use again a xlabel 'x' and a ylabel 'f(x)'. Add a grid to the plot. 4- Create an array x with values which range from -5 to 5 with a step of 0.1. Then create another array f as follows: f = X.^2 +2*x-1. Finally, create a function ff as follows: ff-@(x)x.^2+2*x-1. Notice that both f and ff are attempting to implement the mathematical function f(x) = X+2x-1. However, only ff is actually a function. The array f simply includes a certain number of values from function f(x). These are the values of f(x) which correspond to those values of the argument x which are equal to the ones found in array x. (a) What is the value of k in f(k) so that f(k) is equal to f(2.3)? Put the answer as a comment in your *.m file, and also explain how you calculated/found the correct value of k. Also include f(k) as one line of code, but replace k with the value that you calculated/found (b) What is the value of m in ff(m) so that ff(m) is equal to f(2.3)? Put this answer as a comment in your *.m file, and also explain how you calculated/found the correct value of m. Also, include ff(m) as one line of code, but replace m with the value that you calculated/found (c) Use x and f to create a plot of the mathematical function f(x) for x ranging from -3 to 3. Show this plot in figure(1). Use a xlabel X, and a ylabel 'f(x). Add a grid to the plot. (d) Now, use x and ff to create a plot of the mathematical function f(x) for ranging from-3 to 3. Show this plot in figure(2). Use again a xlabel 'x' and a ylabel 'f(x)'. Add a grid to the plot

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!